Auth API reference

Auth API · Credentials

put/v1/apps/{app_id}/credentials/{client_id}/scopesAuth

Set scopes for an M2M client

Path parameters

app_id*string

Id of the app.

client_id*string

Id of the client.

Request body

permissions*array

Permission strings in resource.action format to assign as scopes

Example: ["user.read","app.read"]

Response · 200 Scopes updated. Returns the scopes the credential now holds.

Array of object

resource*string

Resource half of the permission key (`resource.action`).

Example: "user"

action*string

Action half of the permission key (`resource.action`).

Example: "read"

Example

Request

PUT https://api.auth.productcraft.co/v1/apps/{app_id}/credentials/{client_id}/scopes
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json

{
  "permissions": [
    "user.read",
    "app.read"
  ]
}

Response

[
  {
    "resource": "user",
    "action": "read"
  }
]