---
title: "Create contact"
description: "Creates a customer or supplier. The required kind field is preserved in the returned contact projection."
language: en
canonical_url: "https://exac.mx/docs/en/api/catalog/contacts/create-contact"
md_url: "https://exac.mx/docs/en/api/catalog/contacts/create-contact.md"
---

# Create contact

Creates a customer or supplier. The required kind field is preserved in the returned contact projection.

## Request

`POST /v1/contacts`

- **Authorization:** Permission depends on the body `kind`: `customer` → `customers:manage`, `supplier` → `providers:manage`.

- **Environments:** Production and sandbox

- **Idempotency:** Required

## Canonical machine contract

This fragment is generated from the canonical operation and Zod contracts used by the route.

```json
{
  "method": "POST",
  "path": "/v1/contacts",
  "operation": {
    "operationId": "createContact",
    "tags": [
      "Contacts"
    ],
    "summary": "Create contact",
    "description": "Creates a customer or supplier. The required kind field is preserved in the returned contact projection.",
    "security": [
      {
        "bearerAuth": []
      }
    ],
    "parameters": [
      {
        "name": "Idempotency-Key",
        "in": "header",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "description": "Unique retry key for this exact operation. Reuse it only when retrying the same request."
      }
    ],
    "requestBody": {
      "required": true,
      "content": {
        "application/json": {
          "schema": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "customer"
                  },
                  "legalName": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "rfc": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  },
                  "taxSystem": {
                    "description": "Active SAT tax-system code.",
                    "x-exac-sat-catalog": "tax-systems",
                    "oneOf": [
                      {
                        "type": "string",
                        "title": "SAT c_RegimenFiscal",
                        "description": "View active codes and official names [here](/docs/en/sat-catalogs/invoicing#tax-systems).",
                        "enum": [
                          "601",
                          "603",
                          "605",
                          "606",
                          "607",
                          "608",
                          "610",
                          "611",
                          "612",
                          "614",
                          "615",
                          "616",
                          "620",
                          "621",
                          "622",
                          "623",
                          "624",
                          "625",
                          "626"
                        ]
                      }
                    ]
                  },
                  "phone": {
                    "type": "string"
                  },
                  "address": {
                    "type": "object",
                    "properties": {
                      "street": {
                        "type": "string"
                      },
                      "exterior": {
                        "type": "string"
                      },
                      "interior": {
                        "type": "string"
                      },
                      "neighborhood": {
                        "type": "string"
                      },
                      "city": {
                        "type": "string"
                      },
                      "municipality": {
                        "type": "string"
                      },
                      "state": {
                        "type": "string"
                      },
                      "postalCode": {
                        "type": "string"
                      },
                      "country": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "postalCode",
                      "country"
                    ],
                    "additionalProperties": false
                  },
                  "cfdiUse": {
                    "description": "Active SAT CFDI-use code.",
                    "x-exac-sat-catalog": "cfdi-uses",
                    "oneOf": [
                      {
                        "type": "string",
                        "title": "SAT c_UsoCFDI",
                        "description": "View active codes and official names [here](/docs/en/sat-catalogs/invoicing#cfdi-uses).",
                        "enum": [
                          "G01",
                          "D06",
                          "I07",
                          "I06",
                          "I01",
                          "I05",
                          "D09",
                          "G02",
                          "D04",
                          "I04",
                          "I03",
                          "D08",
                          "G03",
                          "D03",
                          "D02",
                          "D01",
                          "D05",
                          "I02",
                          "CN01",
                          "I08",
                          "CP01",
                          "D10",
                          "D07",
                          "S01"
                        ]
                      }
                    ]
                  },
                  "creditEnabled": {
                    "type": "boolean"
                  },
                  "creditByDefault": {
                    "type": "boolean"
                  },
                  "defaultPaymentTermDays": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 365
                  }
                },
                "required": [
                  "kind",
                  "legalName"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "supplier"
                  },
                  "legalName": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "rfc": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  },
                  "taxSystem": {
                    "description": "Active SAT tax-system code.",
                    "x-exac-sat-catalog": "tax-systems",
                    "oneOf": [
                      {
                        "type": "string",
                        "title": "SAT c_RegimenFiscal",
                        "description": "View active codes and official names [here](/docs/en/sat-catalogs/invoicing#tax-systems).",
                        "enum": [
                          "601",
                          "603",
                          "605",
                          "606",
                          "607",
                          "608",
                          "610",
                          "611",
                          "612",
                          "614",
                          "615",
                          "616",
                          "620",
                          "621",
                          "622",
                          "623",
                          "624",
                          "625",
                          "626"
                        ]
                      }
                    ]
                  },
                  "phone": {
                    "type": "string"
                  },
                  "address": {
                    "type": "object",
                    "properties": {
                      "street": {
                        "type": "string"
                      },
                      "exterior": {
                        "type": "string"
                      },
                      "interior": {
                        "type": "string"
                      },
                      "neighborhood": {
                        "type": "string"
                      },
                      "city": {
                        "type": "string"
                      },
                      "municipality": {
                        "type": "string"
                      },
                      "state": {
                        "type": "string"
                      },
                      "postalCode": {
                        "type": "string"
                      },
                      "country": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "postalCode",
                      "country"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "kind",
                  "legalName"
                ],
                "additionalProperties": false
              }
            ]
          },
          "example": {
            "kind": "customer",
            "legalName": "Estudio Jacaranda",
            "email": "administracion@jacaranda.example"
          }
        }
      }
    },
    "responses": {
      "201": {
        "description": "Operation completed.",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "data": {
                  "$ref": "#/components/schemas/Contact"
                }
              },
              "required": [
                "data"
              ],
              "additionalProperties": false
            },
            "example": {
              "data": {
                "contactId": "customer-example",
                "legalName": "Estudio Jacaranda",
                "email": "administracion@jacaranda.example",
                "rfc": "AAA010101AAA",
                "updatedAt": "2026-07-14T18:00:00.000Z",
                "kind": "customer"
              }
            }
          }
        }
      },
      "400": {
        "description": "Invalid request.\n\n`validation_error`",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "401": {
        "description": "Missing or invalid credential.\n\n`unauthenticated`",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          },
          "WWW-Authenticate": {
            "$ref": "#/components/headers/WWWAuthenticate"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "403": {
        "description": "The credential does not satisfy the required authorization. Permission depends on the body `kind`: `customer` → `customers:manage`, `supplier` → `providers:manage`.\n\n`forbidden`",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          },
          "WWW-Authenticate": {
            "$ref": "#/components/headers/WWWAuthenticate"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "404": {
        "description": "Resource not found.\n\n`not_found`",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "405": {
        "description": "Method not allowed.\n\n`method_not_allowed`",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          },
          "Allow": {
            "$ref": "#/components/headers/Allow"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "409": {
        "description": "The operation conflicts with its current state or idempotency key.\n\nPossible codes: `conflict`, `idempotency_conflict`, `operation_in_progress`, `recovery_required`.",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          },
          "Retry-After": {
            "$ref": "#/components/headers/RetryAfter"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "429": {
        "description": "Too many requests.\n\n`rate_limited`",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          },
          "Retry-After": {
            "$ref": "#/components/headers/RetryAfter"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "500": {
        "description": "Internal server error.\n\n`internal`",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "503": {
        "description": "Service temporarily unavailable.\n\n`provider_unavailable`",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          },
          "Retry-After": {
            "$ref": "#/components/headers/RetryAfter"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      }
    },
    "x-exac-environments": [
      "production",
      "sandbox"
    ]
  },
  "components": {
    "schemas": {
      "ApiError": {
        "type": "object",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ProgrammaticError"
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      },
      "ProgrammaticError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "validation_error",
              "unauthenticated",
              "forbidden",
              "not_found",
              "method_not_allowed",
              "conflict",
              "idempotency_conflict",
              "operation_in_progress",
              "recovery_required",
              "rate_limited",
              "provider_unavailable",
              "internal"
            ],
            "description": "Recommended action by code:\n\n- `validation_error` — Correct each details.issues entry using its path and stable issue code.\n- `unauthenticated` — Provide a valid API key or OAuth access token.\n- `forbidden` — Use a credential with the required permission.\n- `not_found` — Check the organization-scoped resource identifier.\n- `method_not_allowed` — Use the documented HTTP method.\n- `conflict` — Refresh the resource and resolve its current state.\n- `idempotency_conflict` — Use a new idempotency key for a changed request.\n- `operation_in_progress` — Wait for Retry-After, then repeat the exact request.\n- `recovery_required` — Do not retry automatically; reconcile the provider outcome.\n- `rate_limited` — Wait for Retry-After before retrying.\n- `provider_unavailable` — Retry only when the response marks the failure as retryable.\n- `internal` — Retry later and contact support if the error persists."
          },
          "message": {
            "type": "string"
          },
          "details": {
            "type": "object",
            "properties": {
              "issues": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "path": {
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "number"
                          }
                        ]
                      }
                    },
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "path",
                    "message"
                  ],
                  "additionalProperties": false
                }
              },
              "retryable": {
                "type": "boolean"
              },
              "retryAfterSeconds": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              }
            },
            "additionalProperties": false
          },
          "status": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "code",
          "message",
          "status"
        ],
        "additionalProperties": false
      },
      "Contact": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "contactId": {
                "type": "string",
                "minLength": 1
              },
              "legalName": {
                "type": "string"
              },
              "code": {
                "type": "string"
              },
              "email": {
                "type": "string"
              },
              "rfc": {
                "type": "string"
              },
              "taxSystem": {
                "type": "string"
              },
              "phone": {
                "type": "string"
              },
              "address": {
                "type": "object",
                "properties": {
                  "street": {
                    "type": "string"
                  },
                  "exterior": {
                    "type": "string"
                  },
                  "interior": {
                    "type": "string"
                  },
                  "neighborhood": {
                    "type": "string"
                  },
                  "city": {
                    "type": "string"
                  },
                  "municipality": {
                    "type": "string"
                  },
                  "state": {
                    "type": "string"
                  },
                  "postalCode": {
                    "type": "string"
                  },
                  "country": {
                    "type": "string"
                  }
                },
                "required": [
                  "postalCode",
                  "country"
                ],
                "additionalProperties": false
              },
              "updatedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              "kind": {
                "type": "string",
                "const": "customer"
              },
              "cfdiUse": {
                "type": "string"
              },
              "creditEnabled": {
                "type": "boolean"
              },
              "creditByDefault": {
                "type": "boolean"
              },
              "defaultPaymentTermDays": {
                "type": "integer",
                "minimum": 1,
                "maximum": 365
              }
            },
            "required": [
              "contactId",
              "legalName",
              "updatedAt",
              "kind"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "contactId": {
                "type": "string",
                "minLength": 1
              },
              "legalName": {
                "type": "string"
              },
              "code": {
                "type": "string"
              },
              "email": {
                "type": "string"
              },
              "rfc": {
                "type": "string"
              },
              "taxSystem": {
                "type": "string"
              },
              "phone": {
                "type": "string"
              },
              "address": {
                "type": "object",
                "properties": {
                  "street": {
                    "type": "string"
                  },
                  "exterior": {
                    "type": "string"
                  },
                  "interior": {
                    "type": "string"
                  },
                  "neighborhood": {
                    "type": "string"
                  },
                  "city": {
                    "type": "string"
                  },
                  "municipality": {
                    "type": "string"
                  },
                  "state": {
                    "type": "string"
                  },
                  "postalCode": {
                    "type": "string"
                  },
                  "country": {
                    "type": "string"
                  }
                },
                "required": [
                  "postalCode",
                  "country"
                ],
                "additionalProperties": false
              },
              "updatedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              "kind": {
                "type": "string",
                "const": "supplier"
              }
            },
            "required": [
              "contactId",
              "legalName",
              "updatedAt",
              "kind"
            ],
            "additionalProperties": false
          }
        ]
      }
    }
  }
}
```

[OpenAPI 3.1](/openapi.json)

## Equivalent MCP tools

- [`save_contact`](/docs/en/mcp/tools/save_contact.md)

Complete documentation: https://exac.mx/docs/en.md
Agent documentation index: https://exac.mx/docs/en/llms.txt
