Regenerate API key
POSThttps://api.publicsquare.com/api-keys/:id/regenerate
Regenerates an API key's key
and returns the new key.
Permissions
payment-method:write
Request
Path Parameters
id stringrequired
Responses
- 200
- 400
- 401
- 403
- 404
OK
- application/json
- Schema
- Example (auto)
Schema
idstringnullable
API key ID
Example:
key_7Ay5mcUXAxwrN6wQEQUVEHBCJ
account_idstringnullable
Account ID
Example:
acc_B518niGwGYKzig6vtrRVZGGGV
environmentstringnullable
Environment - Can be test
or production
Example:
production
keystringnullable
API key for performing API requests
Example:
pk_prod_6fpAaGyHBeGNpxTpJKMD5w5wk
typestringnullable
API key type - Can be publishable
, secret
or restricted
Example:
publishable
created_atdate-timenullable
Date API key was created
Example:
2024-06-30T01:02:29.212Z
modified_atdate-timenullable
Date API key was modified
Example:
2024-06-30T01:02:29.212Z
namestringrequired
Name of the API key
Possible values: non-empty
and <= 100 characters
Example:
Test Application
permissionsstring[]required
List of permissions to assign to the API key
Possible values: >= 1
Example:
["api-key:write","business:read","business:writer"]
{
"id": "key_7Ay5mcUXAxwrN6wQEQUVEHBCJ",
"account_id": "acc_B518niGwGYKzig6vtrRVZGGGV",
"environment": "production",
"key": "pk_prod_6fpAaGyHBeGNpxTpJKMD5w5wk",
"type": "publishable",
"created_at": "2024-06-30T01:02:29.212Z",
"modified_at": "2024-06-30T01:02:29.212Z",
"name": "Test Application",
"permissions": [
"api-key:write",
"business:read",
"business:writer"
]
}
Bad Request
- application/json
- Schema
- Example (auto)
Schema
errors objectnullable
typestringnullable
titlestringnullable
statusint32nullable
detailstringnullable
instancestringnullable
property name*any
{
"errors": {},
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string"
}
Unauthorized
- application/json
- Schema
- Example (auto)
Schema
typestringnullable
titlestringnullable
statusint32nullable
detailstringnullable
instancestringnullable
property name*any
{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string"
}
Forbidden
- application/json
- Schema
- Example (auto)
Schema
typestringnullable
titlestringnullable
statusint32nullable
detailstringnullable
instancestringnullable
property name*any
{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string"
}
Not Found
- application/json
- Schema
- Example (auto)
Schema
typestringnullable
titlestringnullable
statusint32nullable
detailstringnullable
instancestringnullable
property name*any
{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string"
}
Authorization: X-API-KEY
name: X-API-KEYtype: apiKeyscopes: api-key:write
description: Authorization by API Key inside request's X-API-KEY headerin: header
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.publicsquare.com/api-keys/:id/regenerate");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("X-API-KEY", "<X-API-KEY>");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
ResponseClear