Client

For the purposes of the API, "client" refers to an OAuth2 client/application. This API endpoint is only available to group owners. The assignable roles can be obtained using the Role endpoint.

List all clients

Get the list of all client that belong to the current user's group.

API Request

GET https://api.bespokify.com/v2/clients

Request parameters

Parameter Type Required Description
search string no The text used to search for a client.
orderBy string no The field to order clients by. Possible values: name. Default: name
sort string no The order to sort clients in. Possible values: asc, desc. Default: asc

Example response

[
  {
    "id": "43949d72-524a-4435-8b8a-7eae341a31fe",
    "name": "Client 1",
    "enabled": true,
    "roles": ["patterns"]
  }
]

Create client

API Request

POST https://api.bespokify.com/v2/clients

Request parameters

Parameter Type Required Description
name string yes The client's name
enabled boolean no Whether the client will be enabled or not. Default: true
roles array no The roles to assign to the client.

Example request

{
  "name": "Client 1",
  "roles": ["patterns"]
}

Example response

{
  "id": "8ea867f6-1d1e-4a7a-b062-a1ed01d3bf30",
  "name": "Client 1",
  "clientId": "d78bc932-a8c2-4d6f-a023-14271d70cd30",
  "secret": "4a35cf8a-ea0c-4df4-aad7-944caca02054",
  "enabled": true,
  "roles": ["patterns"]
}

Get single client

API Request

GET https://api.bespokify.com/v2/clients/{id}

Request parameters

Parameter Type Required Description
id string yes The ID of the client to retrieve.

Example response

{
  "id": "8ea867f6-1d1e-4a7a-b062-a1ed01d3bf30",
  "name": "Client 1",
  "clientId": "d78bc932-a8c2-4d6f-a023-14271d70cd30",
  "secret": "4a35cf8a-ea0c-4df4-aad7-944caca02054",
  "enabled": true,
  "roles": ["patterns"]
}

Update client

API Request

PATCH https://api.bespokify.com/v2/clients/{id}

Request parameters

Parameter Type Required Description
name string no The client's new name
enabled boolean no Whether the client will be enabled or not
roles array no The new roles to assign to the client

Example request

{
  "name": "Client 2",
  "roles": ["exports"],
  "enabled": false
}

Example response

{
  "id": "8ea867f6-1d1e-4a7a-b062-a1ed01d3bf30",
  "name": "Client 2",
  "clientId": "d78bc932-a8c2-4d6f-a023-14271d70cd30",
  "secret": "4a35cf8a-ea0c-4df4-aad7-944caca02054",
  "enabled": false,
  "roles": ["exports"]
}

Generate new client secret

Generate a new client secret for an existing client.

API Request

POST https://api.bespokify.com/v2/clients/{id}/secret

Request parameters

Parameter Type Required Description
id string yes The ID of the client that needs a new secret generated.

Example response

{
  "secret": "e02bc2c6-ff09-4f71-9b31-062f5ef7e751"
}

Delete client

API Request

DELETE https://api.bespokify.com/v2/clients/{id}

Request parameters

Parameter Type Required Description
id string yes The ID of the client to delete.

Response status codes

Code Meaning
204 No Content The client was deleted successfully
404 Not Found A client with the provided ID could not be found