Skip to main content

Protekt Account API (1.0.0)

Download OpenAPI specification:Download

The Account API allows you to manage your Protekt organization programmatically. You can create and configure projects, issue and rotate API keys, invite team members, and monitor usage. Note that all requests require a Management Token.

Projects

Create and manage Protekt projects

List all projects

Returns a paginated list of all projects belonging to the authenticated organization.

Authorizations:
ManagementToken
query Parameters
limit
integer <= 100
Default: 20

Max number of results per page

cursor
string

Pagination cursor from the previous response

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "next_cursor": "cur_abc123",
  • "has_more": true
}

Create a project

Create a new Protekt project. A unique login_id is automatically generated and returned.

Authorizations:
ManagementToken
Request Body schema: application/json
required
name
required
string
allowed_origins
required
Array of strings
redirect_url
required
string <uri>
description
string
token_expiry
integer
Default: 3600
refresh_token_expiry
integer
Default: 2592000
mfa_required
boolean
Default: false

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "id": "proj_01jk8abc",
  • "login_id": "lp_7xqm9xyz",
  • "name": "My App – Production",
  • "description": "string",
  • "redirect_url": "https://myapp.com/dashboard",
  • "allowed_origins": [],
  • "token_expiry": 3600,
  • "refresh_token_expiry": 2592000,
  • "mfa_required": false,
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z"
}

Get a project

Retrieve a single project by its ID, including current configuration and generated login_id.

Authorizations:
ManagementToken
path Parameters
id
required
string

The unique project ID (for example, proj_01jk8abc)

Responses

Response samples

Content type
application/json
{
  • "id": "proj_01jk8abc",
  • "login_id": "lp_7xqm9xyz",
  • "name": "My App – Production",
  • "description": "string",
  • "redirect_url": "https://myapp.com/dashboard",
  • "allowed_origins": [],
  • "token_expiry": 3600,
  • "refresh_token_expiry": 2592000,
  • "mfa_required": false,
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z"
}

Update a project

Update one or more configuration fields on an existing project. Only the fields you provide will be changed.

Authorizations:
ManagementToken
path Parameters
id
required
string

The unique project ID (for example, proj_01jk8abc)

Request Body schema: application/json
required
name
string
allowed_origins
Array of strings
redirect_url
string <uri>
token_expiry
integer
mfa_required
boolean

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "allowed_origins": [
    ],
  • "redirect_url": "http://example.com",
  • "token_expiry": 0,
  • "mfa_required": true
}

Response samples

Content type
application/json
{
  • "id": "proj_01jk8abc",
  • "login_id": "lp_7xqm9xyz",
  • "name": "My App – Production",
  • "description": "string",
  • "redirect_url": "https://myapp.com/dashboard",
  • "allowed_origins": [],
  • "token_expiry": 3600,
  • "refresh_token_expiry": 2592000,
  • "mfa_required": false,
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z"
}

Delete a project

Permanently deletes a project and all associated configuration, users, and sessions. This action is irreversible. All active JWTs issued by this project will be immediately invalidated.

Authorizations:
ManagementToken
path Parameters
id
required
string

The unique project ID (for example, proj_01jk8abc)

Responses

Response samples

Content type
application/json
{
  • "deleted": true,
  • "id": "proj_01jk8abc"
}

Management Tokens

Issue and revoke Management Tokens

Request a Management Token

Authenticate with your Protekt account credentials to obtain a Management Token. This token is required for all Account API requests.

Request Body schema: application/json
required
email
required
string <email>
password
required
string <password>

Responses

Request samples

Content type
application/json
{
  • "email": "user@example.com",
  • "password": "pa$$word"
}

Response samples

Content type
application/json
{
  • "management_token": "mgmt_eyJhbGciOiJIUz...",
  • "expires_at": "2019-08-24T14:15:22Z"
}

Revoke the current Management Token

Immediately invalidate the current Management Token. Use this when rotating credentials or ending an admin session.

Authorizations:
ManagementToken

Responses

Response samples

Content type
application/json
{
  • "revoked": true
}

API Keys

Generate and manage project API keys

List API keys

List all API keys for the organization. Key values are never returned — only metadata.

Authorizations:
ManagementToken
query Parameters
project_id
string

Filter keys by a specific project

limit
integer <= 100
Default: 20

Max number of results per page

Responses

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Create an API key

Generate a new API key scoped to a specific project. The raw key value is only returned once at creation time — store it securely.

Authorizations:
ManagementToken
Request Body schema: application/json
required
project_id
required
string
label
required
string
scopes
Array of strings
Default: ["auth:read","auth:write","users:read","users:write"]
Items Enum: "auth:read" "auth:write" "users:read" "users:write"
expires_at
string or null <date-time>

Responses

Request samples

Content type
application/json
{
  • "project_id": "string",
  • "label": "string",
  • "scopes": [
    ],
  • "expires_at": "2019-08-24T14:15:22Z"
}

Response samples

Content type
application/json
{
  • "id": "key_xk901abc",
  • "key": "pk_live_AbCdEfGh...",
  • "label": "Backend server – production",
  • "project_id": "proj_01jk8abc",
  • "scopes": [
    ],
  • "expires_at": "2019-08-24T14:15:22Z",
  • "created_at": "2019-08-24T14:15:22Z"
}

Revoke an API key

Permanently revoke an API key. Any service using this key will immediately lose access to the Authentication API.

Authorizations:
ManagementToken
path Parameters
id
required
string

The unique API key ID (for example, key_xk901abc)

Responses

Response samples

Content type
application/json
{
  • "revoked": true,
  • "id": "key_xk901abc"
}

Members

Manage organization team members

List organization members

List all members of the organization with their roles and access levels.

Authorizations:
ManagementToken

Responses

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Invite a member

Send an invitation email to add a new member to the organization.

Authorizations:
ManagementToken
Request Body schema: application/json
required
email
required
string <email>
role
required
string
Enum: "admin" "developer"

Responses

Request samples

Content type
application/json
{
  • "email": "user@example.com",
  • "role": "admin"
}

Response samples

Content type
application/json
{
  • "message": "Invitation sent to dev@acme.com"
}

Remove a member

Remove a member from the organization. They immediately lose all dashboard and API access.

Authorizations:
ManagementToken
path Parameters
id
required
string

The unique member ID (for example, mem_001)

Responses

Response samples

Content type
application/json
{
  • "removed": true
}

Usage

Retrieve usage and MAU metrics

Get usage statistics

Retrieve usage stats for the organization or a specific project, including Monthly Active Users (MAU) and login event counts.

Authorizations:
ManagementToken
query Parameters
project_id
string

Scope metrics to a specific project

from
string <date>

ISO 8601 start date for the reporting window

to
string <date>

ISO 8601 end date. Defaults to today.

Responses

Response samples

Content type
application/json
{
  • "period": {
    },
  • "mau": 1842,
  • "total_logins": 9231,
  • "tokens_issued": 11004,
  • "passwordless_logins": 3120,
  • "sso_logins": 894
}