Store the client_id and client_secret from your own platform developer app.
This is required before Dravo can generate connect URLs for that platform. The
secret is encrypted at rest.
To send users back to your product after connecting, set allowed_return_urls.
Only URLs in this allowlist can be used as return_url in the connect URL flow.
/v1/oauth-appsAdd platform credentials (your client_id/client_secret). The secret is encrypted and never returned.
AuthorizationstringheaderrequiredBearer token. Use a Dravo API key (`dra_…`) or a dashboard JWT.
Content-TypestringheaderrequiredMust be `application/json` for requests with a JSON body.
platformstringrequiredinstagram | facebook | x | linkedin | tiktok.
namestringrequired1 to 120 chars.
client_idstringrequiredYour platform app's client id / client key.
client_secretstringrequiredYour platform app's client secret (stored encrypted).
allowed_return_urlsstring[]Allowlist (up to 20) of URLs the Connect flow may redirect users back to. Matched by origin + path prefix.
idstringOAuth app id.
platformstringPlatform this app authenticates.
namestringLabel you gave this app.
client_idstringoptionalYour platform app client id.
redirect_uristringBackend callback to register on your platform app.
scopesstring[]Scopes Dravo will request.
allowed_return_urlsstring[]Allowlisted return URLs for the Connect flow.
const response = await fetch("https://api.dravo.dev/v1/oauth-apps", { method: "POST", headers: { "Authorization": "Bearer " + process.env.DRAVO_API_KEY, "Content-Type": "application/json",}, body: JSON.stringify({ "platform": "x", "name": "My X App", "client_id": "…", "client_secret": "…", "allowed_return_urls": [ "https://app.acme.com/connect" ]})});const data = await response.json();console.log(data);{ "id": "oa_1", "platform": "x", "name": "My X App", "client_id": "…", "redirect_uri": "https://api.dravo.dev/v1/oauth/x/callback", "scopes": [ "tweet.write", "tweet.read", "users.read", "offline.access", "media.write" ], "allowed_return_urls": [ "https://app.acme.com/connect" ]}