For the complete documentation index, see llms.txt. This page is also available as Markdown.

OAuth

OAuth2 client management

Create OAuth client

post

Create a new OAuth2 client application.

Required permissions, when user-scoped authentication is used: OAUTH_TOKEN_CREATE. Also, when the user-scoped authentication is used, user should have developer mode enabled.

Authorizations
AuthorizationstringRequired

OAuth2 Bearer token obtained from authentication endpoint

Body
orgIdinteger · int32Optional

Organization ID, in which OAuth client will be created. If not provided, the organization, that is associated with the authentication token, will be used.

Example: 101
namestring · min: 1 · max: 64Required

Client application name

Example: My IoT App
redirectUrlsstring · uri[] · max: 10Optional

Redirect URIs

Example: https://myapp.com/oauth/callback
Responses
201

OAuth client created successfully

application/json
orgIdinteger · int32Required

Organization ID, that the client belongs to

Example: 101
namestringRequired

Client application name

Example: My IoT App
clientIdstringRequired

OAuth client ID

Example: oa2-client-id_s5XUlzvfaQL8BVkteN6DuIdUxdX7u0lJ
secretstringRequired

OAuth client secret

Example: xDG7p4mu4J37P4aoa0TXCFr1hii35j_775S-2dKs
redirectUrlsstring[]Optional

Allowed redirect URIs

Example: https://myapp.com/oauth/callback
post/api/v1/organization/oauth/clients/create
POST /api/v1/organization/oauth/clients/create HTTP/1.1
Host: blynk.cloud
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 151

{
  "orgId": 101,
  "name": "My IoT App",
  "redirectUrls": [
    "https://myapp.com/oauth/callback"
  ],
  "scopes": [
    "PLATFORM_API",
    "CLIENT_CREDENTIALS",
    "DEVICES_GET_ONLY"
  ]
}
{
  "orgId": 101,
  "name": "My IoT App",
  "clientId": "oa2-client-id_s5XUlzvfaQL8BVkteN6DuIdUxdX7u0lJ",
  "secret": "xDG7p4mu4J37P4aoa0TXCFr1hii35j_775S-2dKs",
  "redirectUrls": [
    "https://myapp.com/oauth/callback"
  ],
  "scopes": [
    "PLATFORM_API"
  ]
}

Last updated

Was this helpful?