Skip to main content
POST
/
public
/
api-keys
/
create
Create API key
curl --request POST \
  --url https://api.pcxpay.com/v1/public/api-keys/create \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "name": "Production Integration",
  "org_id": "<string>",
  "user_id": "<string>",
  "status": "active"
}
'
{
  "status": "success",
  "message": "Operation completed successfully",
  "data": {
    "api_key_id": "<string>",
    "prefix": "pcx_abc123",
    "name": "Production Integration",
    "org_id": "<string>",
    "user_id": "<string>",
    "status": "active",
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z",
    "key": "pcx_abc123_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  }
}

Authorizations

X-API-Key
string
header
required

API key issued by PCX. Pass the full key string in the X-API-Key request header. The key encodes your organisation and user identity and is verified on every request.

Body

application/json
name
string
required

Human-readable label for this key (e.g. "Production Integration")

Example:

"Production Integration"

org_id
string
required

Organisation the key will be scoped to

user_id
string
required

User who owns this key

status
enum<string>
Available options:
active,
inactive,
revoked
Example:

"active"

Response

API key created

status
enum<string>
Available options:
success,
error
Example:

"success"

message
string
Example:

"Operation completed successfully"

data
object