v1

latestOpenAPI 3.1.0© Copyright Partoo2026-07-26163503484.0 KB
ApiKeys

Create API key

This endpoint lets you create a new API key.

For more details on how API keys work, and how to handle them securely, see the Security and API Key Usage guide.

post/api_keys

Request body

labelstring

Name given to recognize the Api key

descriptionstring

Description of the API key

expiration_datestring

Must be at least the day after today. If you want it to expire today you must revoke it. You can set it to null.

ip_whiteliststring[]

List of IP or CIDR network notations to which API Key calls are restricted.

Empty list means no restriction.

has_restricted_permissionsboolean

Whether or not the API key has customized permissions. If false, it has the same permissions as the user who created the key.

⚠️ Required if the permissions parameter is provided. ⚠️

permissionsstring[]

List of permission names to assign to the API Key.

⚠️ Required if the has_restricted_permissions parameter is provided. ⚠️

Example request

{
  "label": "API key name",
  "description": "API key for updating business name, and categories.",
  "expiration_date": "2022-06-05",
  "ip_whitelist": [
    "172.16.0.0/12",
    "127.0.0.1"
  ],
  "has_restricted_permissions": true,
  "permissions": [
    "business_edit",
    "business_edit_name",
    "business_edit_categories"
  ]
}

Response

Created

idinteger
labelstring

Name given to recognize the Api key

descriptionstring

Description of the API key

user_idstring

User id

user_namestring

User first name and last name concatenated. Can be null if it's your org integration api key.

user_role'PROVIDER' | 'ORG_ADMIN' | 'ORG_MANAGER' | 'GROUP_MANAGER' | 'BUSINESS_MANAGER' | 'PUBLISHER'

User role in the application

user_type'bot' | 'user'

Whether the API key belongs to a bot user (created automatically for integrations) or a regular human user.

disabledboolean

Is true if someone revoked the key.

expiration_datestring

Must be at least the day after today. If you want it to expire today you must revoke it. You can set it to null.

last_used_atstring
created_bystring

User id

created_by_namestring

First name and last name concatenated of the user that created the key

created_atstring
revoked_bystring

User id

revoked_by_namestring

First name and last name concatenated of the user that revoked the key

revoked_atstring
ip_whiteliststring[]

List of IP or CIDR network notations to which API Key calls are restricted.

Empty list means no restriction.

has_restricted_permissionsboolean

Whether or not the API key has customized permissions. If false, it has the same permissions as the user who created the key.

permissionsstring[]

List of permission names linked to the API Key.

Example response

{
  "id": 3245,
  "label": "API key name",
  "description": "API key for updating business name, and categories.",
  "user_id": "5309c3a237bbc544d8e26737",
  "user_name": "Perceval de Galles",
  "user_role": "BUSINESS_MANAGER",
  "user_type": "user",
  "expiration_date": "2022-06-05",
  "last_used_at": "2019-08-22 11:46:38.914467+00",
  "created_by": "5309c3a237bbc544d8e26737",
  "created_by_name": "John Smith",
  "created_at": "2018-03-12 11:49:03.399475+00",
  "revoked_by": "5309c3a237bbc544d8e26737",
  "revoked_by_name": "John Smith",
  "revoked_at": "2020-10-20 11:46:38.914467+00",
  "ip_whitelist": [
    "172.16.0.0/12",
    "127.0.0.1"
  ],
  "has_restricted_permissions": true,
  "permissions": [
    "business_edit",
    "business_edit_name",
    "business_edit_categories"
  ]
}