Appearance
REST API: CRM Contacts
5 endpoints.
GET /api/v1/rest/contacts
List contacts
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
page | query | no | integer | |
per_page | query | no | integer | |
search | query | no | ||
created_since | query | no | ||
updated_since | query | no | ||
sort | query | no |
200 — Successful Response
json
{
"type": "object",
"additionalProperties": true,
"title": "Response List Contacts Api V1 Rest Contacts Get"
}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}POST /api/v1/rest/contacts
Create a contact
Request body
json
{
"properties": {
"full_name": {
"anyOf": [
{
"type": "string",
"maxLength": 255
},
{
"type": "null"
}
],
"title": "Full Name"
},
"email": {
"anyOf": [
{
"type": "string",
"maxLength": 320
},
{
"type": "null"
}
],
"title": "Email"
},
"phone": {
"anyOf": [
{
"type": "string",
"maxLength": 64
},
{
"type": "null"
}
],
"title": "Phone"
},
"company": {
"anyOf": [
{
"type": "string",
"maxLength": 255
},
{
"type": "null"
}
],
"title": "Company"
}
},
"type": "object",
"title": "ContactIn"
}201 — Successful Response
json
{
"type": "object",
"additionalProperties": true,
"title": "Response Create Contact Api V1 Rest Contacts Post"
}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}GET /api/v1/rest/contacts/search
Find contacts by email or phone
Exact email (case-insensitive) or phone. Phone matches the stored canonical spelling (app.utils.phone.canonical_phone, what every CRM write stores) or, failing that, the last nine digits — so +27 82 … and 082 … find the same person.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
email | query | no | ||
phone | query | no |
200 — Successful Response
json
{
"type": "object",
"additionalProperties": true,
"title": "Response Search Contacts Api V1 Rest Contacts Search Get"
}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}GET /api/v1/rest/contacts/{contact_id}
Get a contact
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
contact_id | path | yes | string |
200 — Successful Response
json
{
"type": "object",
"additionalProperties": true,
"title": "Response Get Contact Api V1 Rest Contacts Contact Id Get"
}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}PATCH /api/v1/rest/contacts/{contact_id}
Update a contact
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
contact_id | path | yes | string |
Request body
json
{
"properties": {
"full_name": {
"anyOf": [
{
"type": "string",
"maxLength": 255
},
{
"type": "null"
}
],
"title": "Full Name"
},
"email": {
"anyOf": [
{
"type": "string",
"maxLength": 320
},
{
"type": "null"
}
],
"title": "Email"
},
"phone": {
"anyOf": [
{
"type": "string",
"maxLength": 64
},
{
"type": "null"
}
],
"title": "Phone"
},
"company": {
"anyOf": [
{
"type": "string",
"maxLength": 255
},
{
"type": "null"
}
],
"title": "Company"
}
},
"type": "object",
"title": "ContactIn"
}200 — Successful Response
json
{
"type": "object",
"additionalProperties": true,
"title": "Response Update Contact Api V1 Rest Contacts Contact Id Patch"
}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}