Skip to content

Unsubscribe contact from a brand

DELETE
/v1/contacts/{emailMd5}/subscriptions/{brandId}
curl --request DELETE \
--url https://api.optizmo.com/deploy/v1/contacts/93942e96f5acd83e2e047ad8fe03114d/subscriptions/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \
--header 'Authorization: <Authorization>'

Unsubscribes the contact from the brand. Returns 400 when the brand id is not a brand in your account, or when the contact is not subscribed to the brand. 404 is returned when the contact itself does not exist.

emailMd5
required
string
/^[A-Fa-f0-9]{32}$/

The contact identity: the MD5 hex digest of the lowercased email address, md5(lower(email)). Uppercase hex digests are accepted. For example, the contact with email Test@Email.com is addressed by md5('test@email.com') = 93942e96f5acd83e2e047ad8fe03114d.

brandId
required
string format: uuid

Id of the brand to unsubscribe the contact from. Must be a brand in your account.

The contact has been unsubscribed from the brand.

The brand id is not a brand in your account, or the contact is not subscribed to the brand.

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
Examples

Brand id is not a brand in your account

{
"type": "https://docs.optizmo.com/deploy/error-codes#invalid_request_error",
"status": 400,
"title": "Invalid request",
"detail": "Unknown brand id(s): 497f6eca-6276-4993-bfeb-53cbbbba6f08",
"code": "invalid_request_error",
"instance": "/deploy/v1/contacts/93942e96f5acd83e2e047ad8fe03114d/subscriptions/497f6eca-6276-4993-bfeb-53cbbbba6f08"
}

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

No contact with this emailMd5 exists in your account.

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#not_found_error",
"status": 404,
"title": "Not found",
"detail": "Contact not found",
"code": "not_found_error",
"instance": "/deploy/v1/contacts/93942e96f5acd83e2e047ad8fe03114d"
}

A bulk contact operation or schema change is in progress for this account (code: operation_in_progress). Retry after the number of seconds given in the Retry-After header.

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#operation_in_progress",
"status": 409,
"title": "Conflict",
"detail": "A bulk contact operation or schema change is in progress for this account, retry later",
"code": "operation_in_progress",
"instance": "/deploy/v1/contacts/93942e96f5acd83e2e047ad8fe03114d"
}
Retry-After
integer

Seconds to wait before retrying.