Get contact schema
const url = 'https://api.optizmo.com/deploy/v1/contact-schema';const options = {method: 'GET', headers: {Authorization: '<Authorization>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.optizmo.com/deploy/v1/contact-schema \ --header 'Authorization: <Authorization>'Returns your account’s contact attribute schema. These are the attributes
accepted in POST /deploy/v1/contacts and PATCH /deploy/v1/contacts/{emailMd5} bodies.
Two predefined attributes are not writable as attribute keys: the Email
identity attribute is set once via the create request’s email field, and the
Brand attribute is managed via the subscriptions and the create
request’s brandIds field.
Authorizations
Section titled “Authorizations ”Responses
Section titled “ Responses ”The account’s contact attribute schema.
object
The account’s contact attributes in schema order.
object
The key used in contact create and patch bodies and in the attributes field of contact responses.
Omitted when the attribute has no description.
Examples
The predefined Email and Brand attributes plus a custom first_name attribute
Every account has the predefined Email and Brand attributes. first_name is an example of a custom attribute. The custom attributes returned for your account will differ.
{ "attributes": [ { "name": "Email", "type": "email", "description": "Plaintext, MD5, SHA-512, Domain" }, { "name": "Brand", "type": "array", "description": "The brand(s) that a contact is subscribed to." }, { "name": "first_name", "type": "string", "description": "Contact first name" } ]}Missing or invalid API key.
Error envelope returned by every v1 endpoint for failures, following RFC 9457
Problem Details with code and errors extensions.
object
URI identifying the problem type; dereferences to its documentation.
HTTP status code applicable to this problem.
Short, human-readable summary of the problem type.
Detailed explanation specific to this occurrence.
Error code identifying the specific error condition.
URI reference identifying this specific occurrence (the request URI).
Provides additional information when the error relates to specific request fields.
object
Detailed explanation for this specific field error.
JSON Pointer (RFC 6901) to the request body value that caused the error (e.g. /email, /attributes/firstName).
The URI query parameter that caused the error (e.g. pageSize, name[invalid]).
Example
{ "type": "https://docs.optizmo.com/deploy/error-codes#authentication_error", "status": 401, "title": "Authentication failed", "detail": "credentials required", "code": "authentication_error", "instance": "/deploy/v1/contacts"}Permission denied.
Error envelope returned by every v1 endpoint for failures, following RFC 9457
Problem Details with code and errors extensions.
object
URI identifying the problem type; dereferences to its documentation.
HTTP status code applicable to this problem.
Short, human-readable summary of the problem type.
Detailed explanation specific to this occurrence.
Error code identifying the specific error condition.
URI reference identifying this specific occurrence (the request URI).
Provides additional information when the error relates to specific request fields.
object
Detailed explanation for this specific field error.
JSON Pointer (RFC 6901) to the request body value that caused the error (e.g. /email, /attributes/firstName).
The URI query parameter that caused the error (e.g. pageSize, name[invalid]).
Example
{ "type": "https://docs.optizmo.com/deploy/error-codes#permission_error", "status": 403, "title": "Permission denied", "detail": "api key required", "code": "permission_error", "instance": "/deploy/v1/contacts"}