Accounts

Get a list of accounts

get

/accounts

Authorizations
Query parameters
cursorstring

The cursor to use for pagination.

limitinteger · int64required

The number of accounts to fetch. Defaults to 100. Must be greater than 0 and less than 1000.

Responses
curl -L \
  --url 'https://api.usepylon.com/accounts?limit=1' \
  --header 'Authorization: Bearer JWT'
{
  "pagination": {
    "cursor": "text",
    "has_next_page": true
  },
  "request_id": "text",
  "data": [
    {
      "created_at": "text",
      "domain": "text",
      "id": "text",
      "latest_customer_activity_time": "text",
      "name": "text",
      "owner": {
        "id": "text"
      },
      "primary_domain": "text",
      "type": "text",
      "channels": [
        {
          "channel_id": "text",
          "source": "text"
        }
      ],
      "custom_fields": {
        "ANY_ADDITIONAL_PROPERTY": {
          "slug": "text",
          "value": "text",
          "values": [
            "text"
          ]
        }
      },
      "domains": [
        "text"
      ],
      "external_ids": [
        {
          "external_id": "text",
          "label": "text"
        }
      ],
      "tags": [
        "text"
      ]
    }
  ]
}

Create a new account

post

/accounts

Authorizations
Body
domainstring

Deprecated. Please use Domains and PrimaryDomain instead.

logo_urlstring

The logo URL of the account. Must be a square .png, .jpg or .jpeg.

namestringrequired

The name of the account.

primary_domainstring

Must be in the list of domains. If there are any domains, there must be exactly one primary domain.

channelsobject[]

An array of channels to be linked to this account.

custom_fieldsobject[]

An array of custom fields to be used on this account.

domainsstring[]

The domains of the account, without any leading scheme, for example stripe.com. Must specify one domain as primary.

external_idsobject[]

An array of external IDs to be used on this account. If provided, the accounts external IDs will be updated to the given external IDs.

tagsstring[]

An array of strings to use as tags on this account. If provided, the accounts tags will be updated to the given tags.

Responses
curl -L \
  --request POST \
  --url 'https://api.usepylon.com/accounts' \
  --header 'Authorization: Bearer JWT' \
  --header 'Content-Type: application/json' \
  --data '{"name":"text","channels":[{}],"custom_fields":[{"values":[null]}],"domains":[null],"external_ids":[{}],"tags":[null]}'
{
  "data": {
    "created_at": "text",
    "domain": "text",
    "id": "text",
    "latest_customer_activity_time": "text",
    "name": "text",
    "owner": {
      "id": "text"
    },
    "primary_domain": "text",
    "type": "text",
    "channels": [
      {
        "channel_id": "text",
        "source": "text"
      }
    ],
    "custom_fields": {
      "ANY_ADDITIONAL_PROPERTY": {
        "slug": "text",
        "value": "text",
        "values": [
          "text"
        ]
      }
    },
    "domains": [
      "text"
    ],
    "external_ids": [
      {
        "external_id": "text",
        "label": "text"
      }
    ],
    "tags": [
      "text"
    ]
  },
  "request_id": "text"
}

Get an account by its ID

get

/accounts/{id}

Authorizations
Path parameters
idstringrequired

The ID or external ID of the account to fetch.

Responses
curl -L \
  --url 'https://api.usepylon.com/accounts/{id}' \
  --header 'Authorization: Bearer JWT'
{
  "data": {
    "created_at": "text",
    "domain": "text",
    "id": "text",
    "latest_customer_activity_time": "text",
    "name": "text",
    "owner": {
      "id": "text"
    },
    "primary_domain": "text",
    "type": "text",
    "channels": [
      {
        "channel_id": "text",
        "source": "text"
      }
    ],
    "custom_fields": {
      "ANY_ADDITIONAL_PROPERTY": {
        "slug": "text",
        "value": "text",
        "values": [
          "text"
        ]
      }
    },
    "domains": [
      "text"
    ],
    "external_ids": [
      {
        "external_id": "text",
        "label": "text"
      }
    ],
    "tags": [
      "text"
    ]
  },
  "request_id": "text"
}

Update an existing account

patch

/accounts/{id}

Authorizations
Path parameters
idstringrequired

The ID of the account to update.

Body
namestring

The name of the account.

owner_idstring

The ID of the owner of the account.

primary_domainstring

Must be in the list of domains. If there are any domains, there must be exactly one primary domain.

channelsobject[]

An array of channels to be linked to this account.

custom_fieldsobject[]

An array of custom fields to be used on this account.

domainsstring[]

Domains of the account. Must specify one domain as primary.

external_idsobject[]

An array of external IDs to be used on this account. If provided, the accounts external IDs will be updated to the given external IDs.

tagsstring[]

An array of strings to use as tags on this account. If provided, the accounts tags will be updated to the given tags.

Responses
curl -L \
  --request PATCH \
  --url 'https://api.usepylon.com/accounts/{id}' \
  --header 'Authorization: Bearer JWT' \
  --header 'Content-Type: application/json' \
  --data '{"channels":[{}],"custom_fields":[{"values":[null]}],"domains":[null],"external_ids":[{}],"tags":[null]}'
{
  "data": {
    "created_at": "text",
    "domain": "text",
    "id": "text",
    "latest_customer_activity_time": "text",
    "name": "text",
    "owner": {
      "id": "text"
    },
    "primary_domain": "text",
    "type": "text",
    "channels": [
      {
        "channel_id": "text",
        "source": "text"
      }
    ],
    "custom_fields": {
      "ANY_ADDITIONAL_PROPERTY": {
        "slug": "text",
        "value": "text",
        "values": [
          "text"
        ]
      }
    },
    "domains": [
      "text"
    ],
    "external_ids": [
      {
        "external_id": "text",
        "label": "text"
      }
    ],
    "tags": [
      "text"
    ]
  },
  "request_id": "text"
}

Currently, the following fields are filterable for accounts:

  • domains. Allowed operators: contains, does_not_contain, in, not_in

  • tags. Allowed operators: contains, does_not_contain, in, not_in

  • name. Allowed operators: equals, in, not_in

  • custom fields (pass in the slug of the custom field)

post

/accounts/search

Authorizations
Body
cursorstring

The cursor to use for pagination.

filterobjectrequired
limitinteger · int64

The number of accounts to fetch. Defaults to 100. Must be greater than 0 and less than 1000.

Responses
curl -L \
  --request POST \
  --url 'https://api.usepylon.com/accounts/search' \
  --header 'Authorization: Bearer JWT' \
  --header 'Content-Type: application/json' \
  --data '{"filter":{"field":"text","operator":"equals","subfilters":[{"field":"text","operator":"equals","subfilters":[{"field":"text","operator":"equals","subfilters":"[Circular Reference]","values":[null]}],"values":[null]}],"values":[null]}}'
{
  "pagination": {
    "cursor": "text",
    "has_next_page": true
  },
  "request_id": "text",
  "data": [
    {
      "created_at": "text",
      "domain": "text",
      "id": "text",
      "latest_customer_activity_time": "text",
      "name": "text",
      "owner": {
        "id": "text"
      },
      "primary_domain": "text",
      "type": "text",
      "channels": [
        {
          "channel_id": "text",
          "source": "text"
        }
      ],
      "custom_fields": {
        "ANY_ADDITIONAL_PROPERTY": {
          "slug": "text",
          "value": "text",
          "values": [
            "text"
          ]
        }
      },
      "domains": [
        "text"
      ],
      "external_ids": [
        {
          "external_id": "text",
          "label": "text"
        }
      ],
      "tags": [
        "text"
      ]
    }
  ]
}

Last updated

Was this helpful?