Skip to Content
sesameSend

Contact Properties

Create and manage Contact Properties

Retrieve a list of contact properties

GET /contact-properties

Query parameters

NameTypeRequiredDescription
limitintegernoNumber of items to return.
afterstringnoReturn items after this cursor.
beforestringnoReturn items before this cursor.

Example

curl -X GET "$SESAMESEND_URL/contact-properties" \
  -H "Authorization: Bearer $OPENSEND_API_KEY"

Responses

StatusDescription
200OK
{
  "object": "list",
  "has_more": true,
  "data": [
    {
      "id": "string",
      "key": "string",
      "type": "string",
      "fallback_value": "string",
      "created_at": "2023-10-06 23:47:56.678+00"
    }
  ]
}

Create a new contact property

POST /contact-properties

Body

FieldTypeRequiredDescription
keystringyesThe property key. Max length is 50 characters. Only alphanumeric characters and underscores are allowed.
type"string" | "number"yesThe property type.
fallback_valuestring | numbernoThe default value to use when the property is not set for a contact. Must match the type specified in the type field.

Example

curl -X POST "$SESAMESEND_URL/contact-properties" \
  -H "Authorization: Bearer $OPENSEND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "key": "string",
  "type": "string"
}'

Responses

StatusDescription
201OK
{
  "id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
  "object": "contact_property"
}

Retrieve a single contact property

GET /contact-properties/{id}

Path parameters

NameTypeRequiredDescription
idstringyesThe Contact Property ID.

Example

curl -X GET "$SESAMESEND_URL/contact-properties/<id>" \
  -H "Authorization: Bearer $OPENSEND_API_KEY"

Responses

StatusDescription
200OK
{
  "object": "contact_property",
  "id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e",
  "key": "company_name",
  "type": "string",
  "fallback_value": "Acme Corp",
  "created_at": "2023-10-06 23:47:56.678+00"
}

Update an existing contact property

PATCH /contact-properties/{id}

Path parameters

NameTypeRequiredDescription
idstringyesThe Contact Property ID.

Body

FieldTypeRequiredDescription
fallback_valuestring | numbernoThe default value to use when the property is not set for a contact. Must match the type of the property.

Example

curl -X PATCH "$SESAMESEND_URL/contact-properties/<id>" \
  -H "Authorization: Bearer $OPENSEND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Responses

StatusDescription
200OK
{
  "id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
  "object": "contact_property"
}

Remove an existing contact property

DELETE /contact-properties/{id}

Path parameters

NameTypeRequiredDescription
idstringyesThe Contact Property ID.

Example

curl -X DELETE "$SESAMESEND_URL/contact-properties/<id>" \
  -H "Authorization: Bearer $OPENSEND_API_KEY"

Responses

StatusDescription
200OK
{
  "id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
  "object": "contact_property",
  "deleted": true
}