API Keys

This API is used to manage api keys under an account. Use this API to create new api key, reset an api key, delete an api key etc.

Create a new api key

Endpoint:

Method: POST
URL: https://api.agenty.com/v2/apikeys

Headers:

Key Value Description
Content-Type application/json

Query params:

Key Value Description
apikey {{API_KEY}} Your api key

Body:

{
  "name": "Key 1",
  "role": "Owner"
}

Responses:

Status: OK | Code: 200

{
    "status_code": "OK",
    "message": "A new api key with id: 57 created successfully",
    "key_id": 57
}

Reset api key by id

Endpoint:

Method: GET
URL: https://api.agenty.com/v2/apikeys/{{KEY_ID}}/reset

Query params:

Key Value Description
apikey {{API_KEY}} Your api key

Responses:

Status: OK | Code: 200

{
    "status_code": 200,
    "message": "Api key with id: 58 reset successfully"
}

Get api key by id

Endpoint:

Method: GET
URL: https://api.agenty.com/v2/apikeys/{{KEY_ID}}

Query params:

Key Value Description
apikey {{API_KEY}} Your api key

Responses:

Status: OK | Code: 200

{
    "key_id": 57,
    "account_id": 14,
    "user_id": 29,
    "name": "Key 1",
    "key": "4a8cead2b286ce590504d32bf3f8cb2d",
    "role": "Owner",
    "created_at": "2022-01-10T04:48:45Z",
    "updated_at": null,
    "is_enabled": true
}

Update API key by id

Endpoint:

Method: PUT
URL: https://api.agenty.com/v2/apikeys/{{KEY_ID}}

Headers:

Key Value Description
Content-Type application/json Your api key

Query params:

Key Value Description
apikey {{API_KEY}}

Body:

{
  "name": "updated Key 1",
  "role": "Owner"
}
	

Responses:

Status: OK | Code: 200

{
    "status_code": 200,
    "message": "Api key with id: 57 updated successfully"
}

Get all API keys

Endpoint:

Method: GET
URL: https://api.agenty.com/v2/apikeys

Query params:

Key Value Description
apikey {{API_KEY}} Your api key
offset {{OFFSET}}
limit {{LIMIT}}
sort {{SORT}}
order {{ORDER}}

Responses:

Status: OK | Code: 200

{
    "total": 2,
    "limit": 1000,
    "offset": 0,
    "returned": 2,
    "result": [
        {
            "key_id": 58,
            "account_id": 14,
            "name": "Key 2",
            "key": "83d2ea0d635824dc3d36c632dd922b9b",
            "role": "Owner",
            "is_enabled": true,
            "created_at": "2022-01-10T05:02:53Z",
            "updated_at": null
        },
        {
            "key_id": 57,
            "account_id": 14,
            "name": "updated Key 1",
            "key": "4a8cead2b286ce590504d32bf3f8cb2d",
            "role": "Owner",
            "is_enabled": false,
            "created_at": "2022-01-10T04:48:45Z",
            "updated_at": "2022-01-10T05:01:45Z"
        }
    ]
}

Delete API key by id

Endpoint:

Method: DELETE
URL: https://api.agenty.com/v2/apikeys/{{KEY_ID}}

Query params:

Key Value Description
apikey {{API_KEY}} Your api key

Responses:

Status: OK | Code: 200

{
    "status_code": 200,
    "message": "1 api key with id: 57 deleted successfully"
}

Signup now to get 100 pages credit free

14 days free trial, no credit card required!