Change the SAML settings
PUT
/api/settings/sso/saml
const url = 'https://forge.example.com/api/settings/sso/saml';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"metadata":"example","nextCertificate":"example","jit":true,"defaultRole":"example","enabled":true,"version":1,"groupsAttribute":"example","secondStepValues":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://forge.example.com/api/settings/sso/saml \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "metadata": "example", "nextCertificate": "example", "jit": true, "defaultRole": "example", "enabled": true, "version": 1, "groupsAttribute": "example", "secondStepValues": "example" }'Takes the identity provider’s metadata (XML), a next certificate ahead of a change, and whether newcomers of the organization’s domains are let in. Turning SAML on turns OpenID Connect off, which moves its version on too. Send the settings’ version as you read it, 0 while nothing was saved. A stale one answers 409 with currentVersion, the version it has now. For administrators.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
metadata
required
null | string
nextCertificate
required
null | string
jit
required
boolean
defaultRole
required
string
enabled
required
boolean
version
required
null | integer | string format: int32
groupsAttribute
null | string
secondStepValues
null | string
Example generated
{ "metadata": "example", "nextCertificate": "example", "jit": true, "defaultRole": "example", "enabled": true, "version": 1, "groupsAttribute": "example", "secondStepValues": "example"}Responses
Section titled “Responses”OK
Media typeapplication/json
object
configured
required
boolean
idpEntityId
required
null | string
ssoUrl
required
null | string
certificates
required
Array<object>
object
subject
required
string
notAfter
required
string format: date-time
sha256
required
string
jit
required
boolean
defaultRole
required
string
enabled
required
boolean
domains
required
Array<string>
entityId
required
string
acsUrl
required
string
metadataUrl
required
string
groupsAttribute
null | string
secondStepValues
null | string
version
integer | string format: int32
Example generated
{ "configured": true, "idpEntityId": "example", "ssoUrl": "example", "certificates": [ { "subject": "example", "notAfter": "2026-04-15T12:00:00Z", "sha256": "example" } ], "jit": true, "defaultRole": "example", "enabled": true, "domains": [ "example" ], "entityId": "example", "acsUrl": "example", "metadataUrl": "example", "groupsAttribute": "example", "secondStepValues": "example", "version": 1}default
Section titled “default”A refusal or an error, as a problem document. A model or draft you may not see answers 404, as one that does not exist.
Media typeapplication/problem+json
object
type
string
title
string
status
integer
detail
string
instance
string
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}