Legacy: Tyk Classic PortalYou’re viewing documentation for the Tyk Classic Portal, which is no longer actively maintained.If you’re looking for the latest API documentation for the new Tyk Developer Portal, please refer to the Postman collection or visit the Tyk Developer Portal section.The Classic Portal is in maintenance mode and will be deprecated soon. For questions or support, contact us at support@tyk.io.

List Developers

PropertyDescription
Resource URL/api/portal/developers
MethodGET
TypeNone
BodyNone
ParamNone

Sample Request

GET /api/portal/developers HTTP/1.1
Host: localhost
authorization:7a7b140f-2480-4d5a-4e78-24049e3ba7f8

Sample Response

{
  "Data": [
    {
      "_id": "554c733a30c55e4b16000002",
      "keys": {
        "<key-id>": ["<policy-id>"]
      },
      "date_created": "2015-05-08T04:26:34.287-04:00",
      "email": "test@test.com",
      "fields": {
        "Name": "Mondgo Brtian",
        "custom1": "Test",
        "custom2": "Test"
      },
      "inactive": false,
      "org_id": "53ac07777cbb8c2d53000002"
    },
    {
      "_id": "5555ec63a8b6b60001000001",
      "keys": {},
      "date_created": "2015-05-15T08:53:54.873-04:00",
      "email": "foo@bar.com",
      "fields": {
        "Name": "Tes",
        "custom1": "",
        "custom2": ""
      },
      "inactive": false,
      "org_id": "53ac07777cbb8c2d53000002"
    },
    ...
  ],
  "Pages": 1
}

Retrieve a developer object by ID

PropertyDescription
Resource URL/api/portal/developers/{id}
MethodGET
TypeNone
BodyDeveloper Object
ParamNone

Sample Request

GET /api/portal/developers/5e397e714ea461ef1d474efa HTTP/1.1
Host: localhost
authorization:7a7b140f-2480-4d5a-4e78-24049e3ba7f8

Sample Response

{
  "id": "5e397e714ea461ef1d474efa",
  "email": "blip@blop.com",
  "date_created": "2020-02-04T16:23:44.936+02:00",
  "inactive": false,
  "org_id": "5a79019d4ea461cdd0c77480",
  "keys": {},
  "subscriptions": {},
  "fields": {},
  "nonce": "",
  "sso_key": "",
  "oauth_clients": {
    "5e397e804ea461ef1d474efb": [
      {
        "client_id": "bf27562a806d4ee1976c11b69e154a88",
        "secret": "NzNiY2M0NWYtNmIwMi00ZjE4LWJhODMtNTc3YzlhMmQyY2I3",
        "redirect_uri": "http://my_redirect_url",
        "app_description": "My App",
        "use_case": "My use case",
        "date_created": "2020-02-04T16:24:21.939+02:00"
      }
    ]
  },
  "password_max_days": 0,
  "password_updated": "2020-02-04T16:23:45.014+02:00",
  "PWHistory": [],
  "last_login_date": "2020-02-04T16:23:00Z"
}

Add a Developer Record

PropertyDescription
Resource URL/api/portal/developers
MethodPOST
TypeNone
BodyDeveloper Object
ParamNone

Sample Request

POST /api/portal/developers HTTP/1.1
Host: localhost
Authorization:7a7b140f-2480-4d5a-4e78-24049e3ba7f8
    
{
  "email": "blip@blop.com",
  "password": "$2a$10$hlG1ujAHWUpnM37k.l1RhO6RrxkCpXki2yrGhufnDs1IBiUo4Kzqy",
  "date_created": "2015-05-15T08:56:13.257-04:00",
  "inactive": false,
  "org_id": "53ac07777cbb8c2d53000002",
  "keys": {
    "<api-key>": ["<policy-id>"]
  },
  "fields": {
    "Name": "",
    "custom1": "",
    "custom2": ""
  }
}

Sample Response

{
  "Status":"OK",
  "Message":"<developer-id>",
  "Meta":""
}

Update a Developer Record

PropertyDescription
Resource URL/api/portal/developers/{id}
MethodPUT
TypeNone
BodyDeveloper Object
ParamNone

Sample Request

PUT /api/portal/developers/5555eceda8b6b60001000004 HTTP/1.1
Host: localhost
Authorization:7a7b140f-2480-4d5a-4e78-24049e3ba7f8
    
{
  "id": "5555eceda8b6b60001000004",
  "email": "blip@blop.com",
  "password": "$2a$10$hlG1ujAHWUpnM37k.l1RhO6RrxkCpXki2yrGhufnDs1IBiUo4Kzqy",
  "date_created": "2015-05-15T08:56:13.257-04:00",
  "inactive": false,
  "org_id": "53ac07777cbb8c2d53000002",
  "keys": {
    "<key-id>": ["<policy-id>"]
  },
  "fields": {
    "Name": "",
    "custom1": "",
    "custom2": ""
  }
}

Sample Response

{
  "Status":"OK",
  "Message":"Data updated",
  "Meta":""
}

Delete a Developer

PropertyDescription
Resource URL/api/portal/developers/{id}
MethodDELETE
TypeNone
BodyNone
ParamNone

Sample Request

DELETE /api/portal/developers/554c733a30c55e4b16000002 HTTP/1.1
Host: localhost
Authorization:7a7b140f-2480-4d5a-4e78-24049e3ba7f8

Sample Response

{
  "Status":"OK",
  "Message":"Data deleted",
  "Meta":""
}

Verify Developer Credentials

NOTE: This functionality is available from v2.3.8 onwards
PropertyDescription
Resource URL/api/portal/developers/verify_credentials
MethodPOST
TypeNone
BodyNone
ParamNone
curl https://admin.cloud.tyk.io/api/portal/developers/verify_credentials \
  -X POST \
  -H "authorization: $TYK_API_KEY" \
  -d \
  '{
     "username": "<developer-email>",
     "password": "<developer-password>"
   }'
If the user credentials are verified, the HTTP response code will be 200 (OK), otherwise credentials do match and a 401 error (Unauthorized) will be returned.

Reset Developer Password

NOTE: This functionality is available from v2.3.8 onwards
PropertyDescription
Resource URL/api/portal/developers/password/:Id
MethodPOST
TypeNone
BodyNone
ParamNone

Sample Request

curl https://admin.cloud.tyk.io/api/portal/developers/password/:Id \
-X POST \
-H "authorization: $TYK_API_KEY" \
-d \
'{
  "password": ""
}'

Sample Response - Password Changed

{
  "Message":"Password changed"
}

Sample Response - Incorrect Developer ID

{
  "Status": "Error", "Message":"Developer password validation failed."
}

Analytics

You can get aggregate statistics for 1 key or all developer keys (need to specify a list of all keys). Also, you can group by day (hour or month), and by API (policy id). API Endpoint: /api/activity/keys/aggregate/#{keys}/#{from}/#{to}?p=-1&res=day
  • keys should be specified separated by ’,’ delimiter.
  • from and to values must be in // format.
  • resolution specified res attribute: ‘day’, ‘hour’ or ‘month’
  • api_id - policy id associated with developer portal API. If ommited return stats for all APIs.

Request

curl "https://admin.cloud.tyk.io/api/activity/keys/aggregate/add2b342,5f1d9603,/5/8/2017/13/8/2017?api_id=8e4d983609c044984ecbb286b8d25cd9&api_version=Non+Versioned&p=-1&res=day" \
-X GET \
-H "authorization: $TYK_API_KEY"

Response

{ "data":[
  {
    "id":{"day":9,"month":8,"year":2017,"hour":0,"code":200},
    "hits":13,
    "success":10,
    "error":3,
    "last_hit":"2017-08-09T12:31:02Z"
  },
  ...
],"pages":0}
In example above add2b342,5f1d9603, is 2 users keys. Note that this example shows hashed key values as described here. Key hashing is turned on for the Cloud, but for Multi-Cloud and Self-Managed installations you can also turn it off. Hashed keys mean that the API administrator does not have access to real user keys, but they can still use the hashed values for showing analytics.

Add Key To Developer

PropertyDescription
Resource URL/portal/developers/:Id/subscriptions
MethodPOST
TypeNone
BodySubscription Object
ParamNone

Sample Request

curl https://admin.cloud.tyk.io/api/portal/developers/:Id/keys \
-X POST \
-H "authorization: $TYK_API_KEY" \
-d \
'{
  "apply_policies": ["<pol-id>"],
  "fields": {
      "foo": "bar"
  },
  "oauth_info": {
    "redirect_uri": "..."
  }
}'

Change Developer Key Policy

PropertyDescription
Resource URL/portal/developers/:developerId/keys/:keyId
MethodPUT
TypeNone
BodyPolicy change Object
ParamNone

Sample Request

curl https://admin.cloud.tyk.io/api/portal/developers/:developerId/keys/:keyId \
-X PUT \
-H "authorization: $TYK_API_KEY" \
-d \
'{
  "apply_policies": ["<pol-id>"]
}'

Revoke Developer Key

PropertyDescription
Resource URL/portal/developers/:developerId/keys/:keyID
MethodDELETE
TypeNone
BodyNone
ParamNone

Reset Developer Key Quota

PropertyDescription
Resource URL/portal/developers/:developerId/keys/:keyID/reset_quota
MethodPOST
TypeNone
BodyNone
ParamNone

Delete OAuth app

PropertyDescription
Resource URL/portal/developers/oauth/:appId
MethodDELETE
TypeNone
BodyNone
ParamNone

Revoke a Single OAuth Client Token

PropertyDescription
Resource URL/oauth-clients/{oauthClientId}/revoke
MethodPOST
TypeJSON
BodyClient Object
ParamNone

Sample Request

POST /oauth-clients/411f0800957c4a3e81fe181141dbc22a/revoke
Host: tyk-portal:3000
Authorization: CSRF token
Body: {
  "token":"eyJvcmciOiI1ZTIwOTFjNGQ0YWVmY2U2MGMwNGZiOTIiLCJpZCI6ImZiMGFmNWQ4ZGY1MzQ3MjY4YmYxNTE5MmJjN2YzN2QyIiwiaCI6Im11cm11cjY0In0=",
  "token_type_hint":"access_token"
}

Sample Response

{
  "Status": "OK",
  "Message": "token revoked successfully",
  "Meta": null
}

Revoke all OAuth Client Tokens

PropertyDescription
Resource URL/oauth-clients/{oauthClientId}/revoke_all
MethodPOST
TypeJSON
BodyClient Object
ParamNone

Sample Request

POST /oauth-clients/411f0800957c4a3e81fe181141dbc22a/revoke_all
Host: tyk-portal:3000
Authorization: CSRF token
Body: {
  "client_secret":"MzUyNDliNzItMDhlNy00MzM3LTk1NWUtMWQyODMyMjkwZTc0"
  }

Sample Response

{
  "Status": "OK",
  "Message": "tokens revoked successfully",
  "Meta": null
}

Deprecated APIS

Add Subscription To Developer

PropertyDescription
Resource URL/portal/developers/:Id/subscriptions
MethodPOST
TypeNone
BodySubscription Object
ParamNone

Sample Request

curl https://admin.cloud.tyk.io/api//portal/developers/:Id/subscriptions \
-X POST \
-H "authorization: $TYK_API_KEY" \
-d \
'{
  "policy_id": "<pol-id>",
  "fields": {
      "foo": "bar"
  },
  "oauth_info": {
    "redirect_uri": "..."
  }
}'

Change Developer Key Policy

PropertyDescription
Resource URL/portal/developers/:developerId/:keyId/:policyId
MethodGET
TypeNone
BodyNone
ParamNone

Revoke Developer Key

PropertyDescription
Resource URL/portal/developers/key/:apiID/:keyID/:Id
MethodDELETE
TypeNone
BodyNone
ParamNone

Reset Developer Key Quota

PropertyDescription
Resource URL/portal/developers/key/:apiID/:keyID/:Id/reset_quota
MethodPOST
TypeNone
BodyNone
ParamNone

Delete OAuth app

PropertyDescription
Resource URL/portal/developers/oauth/:apiId/:appId
MethodDELETE
TypeNone
BodyNone
ParamNone