Accounts

Get a list of accounts.

GEThttps://api.usepylon.com/accounts
Query parameters
Response
Body
dataarray of Account (object)

The data payload of the response.

errorsarray of string

The list of errors, if any.

paginationPagination (object)
request_idstring

The request ID for tracking.

Request
const response = await fetch('https://api.usepylon.com/accounts', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "data": [
    {
      "channels": [
        {
          "channel_id": "text",
          "source": "text"
        }
      ],
      "created_at": "text",
      "domain": "text",
      "domains": [
        "text"
      ],
      "id": "text",
      "latest_customer_activity_time": "text",
      "name": "text",
      "owner": {
        "id": "text"
      },
      "primary_domain": "text",
      "tags": [
        "text"
      ],
      "type": "text"
    }
  ],
  "errors": [
    "text"
  ],
  "pagination": {
    "cursor": "text",
    "has_next_page": false
  },
  "request_id": "text"
}

Create a new account.

POSThttps://api.usepylon.com/accounts
Body
custom_fieldsarray of CustomField (object)

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

domainstring

Deprecated. Please use Domains and PrimaryDomain instead.

domainsarray of string

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

logo_urlstring

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

name*string

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.

tagsarray of string

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

Response
Body
dataAccount (object)
errorsarray of string

The list of errors, if any.

paginationPagination (object)
request_idstring

The request ID for tracking.

Request
const response = await fetch('https://api.usepylon.com/accounts', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "name": "text"
    }),
});
const data = await response.json();
Response
{
  "data": {
    "channels": [
      {
        "channel_id": "text",
        "source": "text"
      }
    ],
    "created_at": "text",
    "domain": "text",
    "domains": [
      "text"
    ],
    "id": "text",
    "latest_customer_activity_time": "text",
    "name": "text",
    "owner": {
      "id": "text"
    },
    "primary_domain": "text",
    "tags": [
      "text"
    ],
    "type": "text"
  },
  "errors": [
    "text"
  ],
  "pagination": {
    "cursor": "text",
    "has_next_page": false
  },
  "request_id": "text"
}

Get an account by its ID.

GEThttps://api.usepylon.com/accounts/{id}
Path parameters
id*string

The ID of the account to fetch.

Response
Body
dataAccount (object)
errorsarray of string

The list of errors, if any.

paginationPagination (object)
request_idstring

The request ID for tracking.

Request
const response = await fetch('https://api.usepylon.com/accounts/{id}', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "data": {
    "channels": [
      {
        "channel_id": "text",
        "source": "text"
      }
    ],
    "created_at": "text",
    "domain": "text",
    "domains": [
      "text"
    ],
    "id": "text",
    "latest_customer_activity_time": "text",
    "name": "text",
    "owner": {
      "id": "text"
    },
    "primary_domain": "text",
    "tags": [
      "text"
    ],
    "type": "text"
  },
  "errors": [
    "text"
  ],
  "pagination": {
    "cursor": "text",
    "has_next_page": false
  },
  "request_id": "text"
}

Update an existing account.

PATCHhttps://api.usepylon.com/accounts/{id}
Path parameters
id*string

The ID of the account to update.

Body
custom_fieldsarray of CustomField (object)

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

domainsarray of string

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

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.

tagsarray of string

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

Response
Body
dataAccount (object)
errorsarray of string

The list of errors, if any.

paginationPagination (object)
request_idstring

The request ID for tracking.

Request
const response = await fetch('https://api.usepylon.com/accounts/{id}', {
    method: 'PATCH',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({}),
});
const data = await response.json();
Response
{
  "data": {
    "channels": [
      {
        "channel_id": "text",
        "source": "text"
      }
    ],
    "created_at": "text",
    "domain": "text",
    "domains": [
      "text"
    ],
    "id": "text",
    "latest_customer_activity_time": "text",
    "name": "text",
    "owner": {
      "id": "text"
    },
    "primary_domain": "text",
    "tags": [
      "text"
    ],
    "type": "text"
  },
  "errors": [
    "text"
  ],
  "pagination": {
    "cursor": "text",
    "has_next_page": false
  },
  "request_id": "text"
}