Skip to content

Create an API key

POST
/api-keys
curl --request POST \
--url https://api.proxyrequest.com/api/v1/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "allowed_ips": [ "198.51.100.25", "203.0.113.10" ] }'

Creates an API key for server-to-server access. allowed_ips can restrict the key to trusted IPv4 or IPv6 addresses.

object
id
string
>= 1 characters <= 36 characters
allowed_ips
Array<string>
Examples
ExampleRestrictKeyByIP

Restrict key by IP

{
"allowed_ips": [
"198.51.100.25",
"203.0.113.10"
]
}

The resource or action result was created successfully.

Media typeapplication/json
object
id
string
<= 36 characters
title
required
string
key
required
string
allowed_ips
Array<string>
created
required
string format: date-time
Examples
ExampleCreatedAPIKey

Created API key

{
"id": "550e8400-e29b-41d4-a716-446655440008",
"title": "Production reporting",
"key": "pk_live_7eb1db5a0b174eddb9e70718197780a8",
"allowed_ips": [
"198.51.100.25",
"203.0.113.10"
],
"created": "2026-07-01T12:30:00Z"
}

The request is malformed or violates a business rule.

Media typeapplication/json

Validation and API error payload. Field names may be added dynamically; field errors are returned as arrays of human-readable messages.

object
detail
string
non_field_errors
Array<string>
translation

Stable translation key suitable for client localisation.

string
key
additional properties
One of:
string
Examples
ExampleValidationError

Validation error

{
"non_field_errors": [
"The request could not be processed."
],
"translation": "errors.request.invalid"
}

Authentication credentials are missing, expired, or invalid.

Media typeapplication/json

Validation and API error payload. Field names may be added dynamically; field errors are returned as arrays of human-readable messages.

object
detail
string
non_field_errors
Array<string>
translation

Stable translation key suitable for client localisation.

string
key
additional properties
One of:
string
Examples
ExampleAuthenticationRequired

Authentication required

{
"detail": "Authentication credentials were not provided."
}

The authenticated account cannot perform this operation.

Media typeapplication/json

Validation and API error payload. Field names may be added dynamically; field errors are returned as arrays of human-readable messages.

object
detail
string
non_field_errors
Array<string>
translation

Stable translation key suitable for client localisation.

string
key
additional properties
One of:
string
Examples
ExamplePermissionDenied

Permission denied

{
"detail": "You do not have permission to perform this action."
}