Update Scope

Endpoint to update a Scope. The name and the rules replace the current ones, with the same format as in the creation (what the rules can contain is in the description of the rules field of the request): the resource types with no rule give no access. The scopes of the teams and the system ones cannot be updated.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Required scopes:
  • scope_write
Fingerprint order:
  • scopeId,name,description,token
Path Params
string
required

The Scope ID.

Body Params

Update Scope JSON parameters.

string
required

The name of the Scope.

string

The description of the Scope.

rules
array of objects
required

The new rules of the Scope: they replace all the current ones. The rules of the Scope, as many as needed. A rule selects resources and either gives access to them (inclusion_mode INCLUDE, the default) or removes it from the resources the other rules select (EXCLUDE). It has:

  • resource_type: USER, COMPANY_CARD, COMPANY_WALLET, MAIN_WALLET or GROUP.
  • selection_mode: which resources of that type. The values admitted depend on the resource_type: see the table.
  • The fields of that selection. A field of the type that does not belong to the selection (e.g. job_titles with ALL) is rejected with a 400 that says what the field is for. A field that does not exist for the resource_type (e.g. labels in a USER rule) is ignored, it is not an error.
resource_typeselection_modeSelectsFields
USERALLall the usersnone
USERREPORTING_TO_MEthe users who report to the user the Scope is used fornone
USERCREATED_BY_MEthe users created by that usernone
USERONLY_MEthat user onlynone
USERSELECTEDthe users in resource_idsresource_ids (required)
USERMATCHING_PROPERTIESthe users with one of the job_titlesjob_titles (required)
COMPANY_CARDALLall the company cardsnone
COMPANY_CARDCREATED_BY_MEthe cards created by the user the Scope is used fornone
COMPANY_CARDASSIGNED_TO_MEthe cards assigned to that usernone
COMPANY_CARDSELECTEDthe cards in resource_idsresource_ids (required)
COMPANY_CARDMATCHING_PROPERTIESthe cards with a label containing one of the labels, and/or one of the currenciesat least one of labels, currencies; with both the card has to match both
COMPANY_WALLETALLall the company walletsnone
COMPANY_WALLETCREATED_BY_MEthe wallets created by the user the Scope is used fornone
COMPANY_WALLETSELECTEDthe wallets in resource_idsresource_ids (required)
COMPANY_WALLETMATCHING_PROPERTIESthe wallets whose currency is one of the currenciescurrencies (required)
MAIN_WALLETALLall the main walletsnone
MAIN_WALLETSELECTEDthe wallets in resource_idsresource_ids (required)
MAIN_WALLETMATCHING_PROPERTIESthe wallets whose currency is one of the currenciescurrencies (required)
GROUPALLall the groupsnone
GROUPCREATED_BY_MEthe groups created by the user the Scope is used fornone
GROUPSELECTEDthe groups in resource_idsresource_ids (required)

Selecting by properties (MATCHING_PROPERTIES). Besides choosing the resources by ID (SELECTED) or by their relation with the user (CREATED_BY_ME, ...), a rule can select the resources that have given properties: set selection_mode to MATCHING_PROPERTIES and give the properties of the resource type. For example, the users with the job title Developer or Manager:

{
  "resource_type": "USER",
  "inclusion_mode": "INCLUDE",
  "selection_mode": "MATCHING_PROPERTIES",
  "job_titles": ["Developer", "Manager"]
}

The properties of each resource type are: job_titles for USER; labels and currencies for COMPANY_CARD; currencies for COMPANY_WALLET and MAIN_WALLET. The values of a property are alternatives (one of them is enough); with more than one property the resource has to match all of them.

Also:

  • resource_ids holds the IDs the API gives to the users, the cards, the wallets and the groups. An ID that is not one of the account is rejected with a 400.
  • Two rules cannot have the same resource_type, inclusion_mode and selection_mode: put all the values in a single rule. The MATCHING_PROPERTIES rules are the exception, each one is an alternative.
  • ALL already selects everything of its resource_type: do not add other INCLUDE rules of that type next to it.
  • A resource_type with no rule gives no access.
rules*
Headers
string
required
Defaults to {{fingerprint}}

Advanced authentication: SHA512SUM of the fingerprint values listed in the fingerprint order for this endpoint.

string
required
Defaults to {{fingerprint_signature}}

Advanced authentication: Signature of the X-Soldo-Fingerprint.

Responses

400

Your request has missing arguments or is malformed. A Scope with the same name already exists. The Scope of a team or a system one is read-only.

403

The management of the Scopes is not enabled for the account.

404

One or more resource requested does not exist.

Language
Credentials
OAuth2
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json