Overview
POST
/oauth/providersoauthCreate a provider from a template or full spec (admin)
Create a record in providers.
Auth: bearerAuth — calls run as the authenticated user.
Request body
application/json · optional
- templateSlugoptionalstring
- slugoptionalstring
- displayNameoptionalstring
- clientIdstring
- clientSecretstring
- scopesoptionalstring[]
- authorizeUrloptionalstring?
- tokenUrloptionalstring?
- userinfoUrloptionalstring?
- authTypeoptional"oauth2_code" | "oauth2_access_token" | "oidc_id_token"
- identityMappingoptionalobject
Example
{
"templateSlug": "string",
"slug": "string",
"displayName": "string",
"clientId": "string",
"clientSecret": "string",
"scopes": [
"string"
],
"authorizeUrl": "string",
"tokenUrl": "string",
"userinfoUrl": "string",
"authType": "oauth2_code",
"identityMapping": {
"subjectField": "string",
"emailField": "string",
"nameField": "string",
"avatarField": "string",
"verificationUrl": "string",
"requireEmailVerified": true,
"allowedAudiences": [
"string"
],
"secondaryEmailUrl": "string"
}
}Responses
201
Provider
- idstring
- slugstring
- namestring
- authType"oauth2_code" | "oauth2_access_token" | "oidc_id_token"
- authorizeUrloptionalstring?
- tokenUrloptionalstring?
- userinfoUrloptionalstring?
- clientIdstring
- scopesstring[]
- identityMappingobject
Example
{
"id": "string",
"slug": "string",
"name": "string",
"authType": "oauth2_code",
"authorizeUrl": "string",
"tokenUrl": "string",
"userinfoUrl": "string",
"clientId": "string",
"scopes": [
"string"
],
"identityMapping": {
"subjectField": "string",
"emailField": "string",
"nameField": "string",
"avatarField": "string",
"verificationUrl": "string",
"jwksUrl": "string",
"requireEmailVerified": true,
"allowedAudiences": [
"string"
],
"secondaryEmailUrl": "string"
}
}400
Error
- erroroptionalobject
Example
{
"error": {
"message": "string",
"code": "string"
}
}409
Error
- erroroptionalobject
Example
{
"error": {
"message": "string",
"code": "string"
}
}Code examples
cURL
curl -X POST "https://api.agenticdeveloperhub.com/oauth/providers" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"templateSlug": "string",
"slug": "string",
"displayName": "string",
"clientId": "string",
"clientSecret": "string",
"scopes": [
"string"
],
"authorizeUrl": "string",
"tokenUrl": "string",
"userinfoUrl": "string",
"authType": "oauth2_code",
"identityMapping": {
"subjectField": "string",
"emailField": "string",
"nameField": "string",
"avatarField": "string",
"verificationUrl": "string",
"requireEmailVerified": true,
"allowedAudiences": [
"string"
],
"secondaryEmailUrl": "string"
}
}'JavaScript
const res = await fetch("https://api.agenticdeveloperhub.com/oauth/providers", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: "{\n \"templateSlug\": \"string\",\n \"slug\": \"string\",\n \"displayName\": \"string\",\n \"clientId\": \"string\",\n \"clientSecret\": \"string\",\n \"scopes\": [\n \"string\"\n ],\n \"authorizeUrl\": \"string\",\n \"tokenUrl\": \"string\",\n \"userinfoUrl\": \"string\",\n \"authType\": \"oauth2_code\",\n \"identityMapping\": {\n \"subjectField\": \"string\",\n \"emailField\": \"string\",\n \"nameField\": \"string\",\n \"avatarField\": \"string\",\n \"verificationUrl\": \"string\",\n \"requireEmailVerified\": true,\n \"allowedAudiences\": [\n \"string\"\n ],\n \"secondaryEmailUrl\": \"string\"\n }\n}",
});
const data = await res.json();