Use this API to get the configuration settings of an app. This is useful for backing up app configuration or cloning apps.
For example, to clone an app you would take the response from this API and POST it to the Create Apps endpoint.
The response payload is broken into sections which group together common attributes such as parameters, sso settings and configuration. The attributes in each section change based on the type of app that has been returned. See below for samples of SAML and OpenId Connect apps.
Resource URL
https://<subdomain>.onelogin.com/api/2/apps/:idHeader Parameters
Authorization required string | Set to Set The access token must have been generated using an API credential pair created using the scope required to call this API. This API can be called using any one of the following scopes: |
Resource Parameters
id required integer | Set to the |
Sample Responses
See the App Resource documentation for detail on the app attributes returned via this API.
- 200 SAML
- 200 OpenId Connect
- 401 Unauthorized
- 404 Not Found
Sample of a SAML app.
{
"id": 928532,
"name": "New AWS app",
"visible": true,
"description": null,
"notes": null,
"icon_url": "https://cdn-shadow.onlgn.net/images/icons/square/amazonwebservices3multirole/old_original.png?1421095823",
"auth_method": 2,
"policy_id": null,
"provisioning": {
"enabled": false
},
"allow_assumed_signin": false,
"tab_id": null,
"connector_id": 50534,
"sso": {
"metadata_url": "https://app.onelogin.com/saml/metadata/5772393d-2ad3-47d6-a64f-2339b1028291",
"acs_url": "https://sharkbytes.onelogin.com/trust/saml2/http-post/sso/928532",
"sls_url": "https://sharkbytes.onelogin.com/trust/saml2/http-redirect/slo/928532",
"issuer": "https://app.onelogin.com/saml/metadata/5772393d-2ad3-47d6-a64f-2339b1028291",
"certificate": {
"value": "c6d814d032f000d9c03bc79727265",
"id": 170216,
"name": "My Companies SAML Certificate"
}
},
"configuration": {
"provider_arn": null,
"signature_algorithm": "SHA-1"
},
"created_at": "2019-05-15T16:07:13Z",
"updated_at": "2019-05-15T16:21:05Z",
"role_ids": [
192513
],
"parameters": {
"https://aws.amazon.com/SAML/Attributes/RoleSessionName": {
"values": null,
"user_attribute_mappings": null,
"provisioned_entitlements": false,
"skip_if_blank": false,
"id": 89806,
"default_values": null,
"attributes_transformations": null,
"safe_entitlements_enabled": false,
"label": "RoleSessionName",
"user_attribute_macros": null
},
"https://aws.amazon.com/SAML/Attributes/Role": {
"values": "chicken",
"user_attribute_mappings": null,
"provisioned_entitlements": false,
"skip_if_blank": false,
"id": 89805,
"default_values": null,
"attributes_transformations": null,
"safe_entitlements_enabled": false,
"label": "Role",
"user_attribute_macros": null
},
"saml_username": {
"values": null,
"user_attribute_mappings": "samaccountname",
"provisioned_entitlements": false,
"skip_if_blank": false,
"id": 89804,
"default_values": null,
"attributes_transformations": null,
"safe_entitlements_enabled": false,
"label": "Amazon Username",
"user_attribute_macros": ""
}
}
}Sample of an OpenId Connect app.
{
"id": 775664,
"name": "OpenId Connect (OIDC) - POST",
"visible": true,
"description": "",
"notes": "",
"icon_url": "/images/missing_connector_icon/square/old_original.png",
"auth_method": 8,
"policy_id": null,
"provisioning": {
"enabled": false
},
"allow_assumed_signin": false,
"tab_id": 196885,
"connector_id": 108419,
"sso": {
"client_id": "78d1d040-20c9-0136-5146-067351775fae92920"
},
"configuration": {
"redirect_uri": "https://localhost:3000/callback",
"refresh_token_expiration_minutes": 1,
"login_url": "",
"oidc_application_type": 0,
"token_endpoint_auth_method": 1,
"access_token_expiration_minutes": 1
},
"created_at": "2018-04-12T21:50:42Z",
"updated_at": "2019-05-16T19:20:34Z",
"role_ids": [
192513
],
"parameters": {
"externalId": {
"values": null,
"user_attribute_mappings": "external_id",
"provisioned_entitlements": false,
"skip_if_blank": false,
"id": 284977,
"default_values": null,
"attributes_transformations": null,
"label": "random",
"user_attribute_macros": "",
"include_in_saml_assertion": true
},
"groups": {
"values": null,
"user_attribute_mappings": "roles",
"provisioned_entitlements": false,
"skip_if_blank": false,
"id": 237825,
"default_values": [
""
],
"attributes_transformations": "semicolon_separated_list",
"label": "Groups",
"user_attribute_macros": null
}
}
}Typically, this error means that your access token value is invalid.
{
"message": "Unauthorized",
"statusCode": 401,
"name": "UnauthorizedError"
}The requested app id does not exist.
{
"message": "The resource with the given id could not be found",
"statusCode": 404,
"name": "NotFoundError"
}Postman Collection
Sample Code
cURL
Replace sample values indicated by < > with your actual values.
Get App
curl 'https://<subdomain>.onelogin.com/api/2/apps/:id' \
-X GET \
-H "Authorization: bearer <access_token>"Have a Question?
Found a problem or a bug? Submit a support ticket.
Looking for walkthroughs or how-to guides? Check out our Knowledge Base.
Have a product idea or request? Share it in our Ideas Portal.