Skip to content

Get contact schema

GET
/v1/contact-schema
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.

The account’s contact attribute schema.

Media type application/json
object
attributes
required

The account’s contact attributes in schema order.

Array<object>
object
name
required

The key used in contact create and patch bodies and in the attributes field of contact responses.

string
type
required
string
Allowed values: string email number boolean array
description

Omitted when the attribute has no description.

string
Examples
Example contact-schema

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.

Media type application/json

Error envelope returned by every v1 endpoint for failures, following RFC 9457 Problem Details with code and errors extensions.

object
type
required

URI identifying the problem type; dereferences to its documentation.

string format: uri
status
required

HTTP status code applicable to this problem.

integer
title
required

Short, human-readable summary of the problem type.

string
detail
required

Detailed explanation specific to this occurrence.

string
code
required

Error code identifying the specific error condition.

string
Allowed values: invalid_request_error authentication_error permission_error not_found_error conflict_error api_error contact_exists operation_in_progress
instance

URI reference identifying this specific occurrence (the request URI).

string format: uri-reference
errors

Provides additional information when the error relates to specific request fields.

Array<object>
object
detail
required

Detailed explanation for this specific field error.

string
pointer

JSON Pointer (RFC 6901) to the request body value that caused the error (e.g. /email, /attributes/firstName).

string
parameter

The URI query parameter that caused the error (e.g. pageSize, name[invalid]).

string
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.

Media type application/json

Error envelope returned by every v1 endpoint for failures, following RFC 9457 Problem Details with code and errors extensions.

object
type
required

URI identifying the problem type; dereferences to its documentation.

string format: uri
status
required

HTTP status code applicable to this problem.

integer
title
required

Short, human-readable summary of the problem type.

string
detail
required

Detailed explanation specific to this occurrence.

string
code
required

Error code identifying the specific error condition.

string
Allowed values: invalid_request_error authentication_error permission_error not_found_error conflict_error api_error contact_exists operation_in_progress
instance

URI reference identifying this specific occurrence (the request URI).

string format: uri-reference
errors

Provides additional information when the error relates to specific request fields.

Array<object>
object
detail
required

Detailed explanation for this specific field error.

string
pointer

JSON Pointer (RFC 6901) to the request body value that caused the error (e.g. /email, /attributes/firstName).

string
parameter

The URI query parameter that caused the error (e.g. pageSize, name[invalid]).

string
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"
}