Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Latest commit

 

History

History
48 lines (40 loc) · 1.89 KB

File metadata and controls

48 lines (40 loc) · 1.89 KB

Create OAuth App

URL Requires Auth HTTP Method
/api/v1/oauth-apps.create yes POST

{% hint style="info" %} Permission required: manage-oauth-apps {% endhint %}

Body Parameters

KeyExample ValueDescription
name*test-oauth-appThe app name that you want to create.
active*trueWhether the app will be active or not. Enter a boolean value, true or false..
redirectUri*https://testuri.comThe URL to redirect the OAuth app.

Example Call

curl 'http://localhost:3000/api/v1/oauth-apps.create' \
  -H 'Content-Type: application/json' \
  -H 'X-Auth-Token: G1xiui60uWU3A2sRuv0seG3zVKpphJls3NuXVFNDH_o' \
  -H 'X-User-Id: YA5aSHTjZNJEGKHhK' \
  --data-raw '{
        "name": "test-oauth-app",
        "redirectUri": "https://testuri.com",
        "active": true }'

Example Response

{
  "application": {
    "name": "test-oauth-app",
    "redirectUri": "https://testuri.com",
    "active": true,
    "clientId": "bN9D5TjY8Cv8GqWfE",
    "clientSecret": "l3HAl0lSr2VaTYZVED6EabyhNzovS8Je2JYmbjNT-V1",
    "_createdAt": "2024-01-17T13:30:41.521Z",
    "_updatedAt": "2024-01-17T13:30:41.521Z",
    "_createdBy": {
      "_id": "JFTcMhEAFbNPfnp49",
      "username": "math.bar"
    },
    "_id": "65a7d68142a7e12453052d56"
  },
  "success": true
}