See api-docs Menu

Update an App

Use this API to update attributes and add parameters to an existing app.









Resource URL

https://<subdomain>/api/2/apps/:id

Header Parameters

Authorization

required

string

Set to bearer <access_token>.

Set <access_token> to the access token you generated using the Generate Token API.

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: Manage All.

Content-Type

required

string

Set to application/json.

Resource Parameter

id

required

integer

Set to the id of the app that you want to update. If you do not know the app id, use the List Apps API call to return all apps and their id values.

Request Parameters

This API supports patial updates or patching of app configuration. Only the attributes specified in the request payload will be updated.

For a complete list of all possible values for a given app it is recommended to do a Get App request on an app that is based of the same connector.

Also see the App Resource for general app attributes.

For example, the following payload could be used to make the app visible in the user portal.

{
  "visible": true
}

Adding New Parameters

If the connector allows it, new parameters can be added with an app update request. To determine if a connector supports custom parameters to be defined check the allows_new_parameters attribute on the List Connectors endpoint.

GET api/2/connectors?name=amazon&auth_method=2

{
  "allows_new_parameters": true,
  "id": 50534,
  "name": "Amazon Web Services (AWS) Multi Role",
  "icon_url": "https://cdn-shadow.onlgn.net/images/icons/square/amazonwebservices3multirole/old_original.png?1421095823",
  "auth_method": 2
}

When new parameters are allowed, any parameter that is added to the parameters object in a request payload will be automatically created if it does not match a parameter name that already exists on the connector.

For example, if the employee_number parameter does not exist on the connector and this payload is supplied a new parameter named employee_number would be created.

{
    "parameters": {
        "employee_number": {
            "values": null,
            "default_values": null,
            "label": "Employee Number"
        }
    }
}

Sample Responses

See the App Resource documentation for detail on the app attributes returned via this API.

On success, the full app configuration is returned.

This is a sample response for an OpenId Connect app.

{
  "id": 928549,
  "name": "Sample OpenId Connect App",
  "visible": true,
  "description": "",
  "notes": null,
  "icon_url": "/images/missing_connector_icon/square/old_original.png",
  "auth_method": 8,
  "policy_id": 165278,
  "provisioning": {
    "enabled": false
  },
  "allow_assumed_signin": false,
  "tab_id": null,
  "connector_id": 108419,
  "sso": {
    "client_secret": "3acdcdba4e57bbb4f0454a8729fbc4ec5c4ac327c8e1d6d60c305cc9ea5dbcd3",
    "client_id": "b5dee2e0-5cbf-0137-6e19-12c80e5197ec92920"
  },
  "configuration": {
    "redirect_uri": "http://example.com/callback",
    "refresh_token_expiration_minutes": 60,
    "login_url": "http://example.com/login",
    "oidc_encryption_key": "",
    "oidc_application_type": 0,
    "token_endpoint_auth_method": 0,
    "access_token_expiration_minutes": 5
  },
  "created_at": "2019-05-19T23:56:57Z",
  "updated_at": "2019-05-19T23:56:57Z",
  "parameters": {
    "groups": {
      "values": null,
      "user_attribute_mappings": null,
      "provisioned_entitlements": false,
      "skip_if_blank": false,
      "id": 237825,
      "default_values": null,
      "attributes_transformations": null,
      "label": "Groups",
      "user_attribute_macros": null,
      "include_in_saml_assertion": true
    }
  }
}

Typically, this error means that your Authorization header value is missing or incorrectly formatted. The Authorization header value should use this format: bearer:<access_token>.

{
    "message": "Unauthorized",
    "statusCode": 401,
    "name": "UnauthorizedError"
}

Indicates that the syntax of the request is good but a value supplied is not valid.

{
    "message": "Validation failed: The associated Policy with ID 0 could not be found",
    "statusCode": 422,
    "name": "UnprocessableEntityError"
}

Postman Collection

Run In Postman

    Clicking Run in Postman button navigates to the page where you can fork the collection to your workspace. Forking the collection into your workspace will enable you to contribute to the source collection using pull requests. You can also view the collection in a public workspace if you like and even import a copy of the collection using the links present on the screen.

Sample Code

cURL

Replace sample values indicated by < > with your actual values.

Update App

curl 'https://<subdomain>/api/2/apps/:id' \
-X PUT \
-H "Authorization: bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{
  "visible": true
}'

Have a Question?

Found a problem or a bug? Submit a support ticket.

Looking for walkthroughs or how-to guides on OneLogin's user and admin features? Check out the documentation in our Knowledge Base.

Have a product idea or request? Share it with us in our Ideas Portal.