Concepts
Authorization in MyCreditApp revolves around the organization entity. Each API client you create belongs to a specific organization. By default, every API client has full access to its own organization. Another key concept is connections. Connections allow one organization to interact with another. To collaborate, one organization must invite another organization (or accept an invitation). Once the invitation is accepted and the invited organization creates its own organization entity, a connection between the two organizations is established.Not all endpoints require authorization - only those that operate on organization-related data.
Scenarios
There are three authorization scenarios when calling the API. These scenarios describe how organizations interact.- Guest – your organization accesses resources of another organization that invited you.
- Host – your organization accesses resources of a connected Guest organization.
- Self – your organization accesses its own resources.
Any organization api client with sufficient permissions can perform a Self call.
Requester-Organization-ID and
Target-Organization-ID headers must be set.
Path params
org_id
The org_id path parameter identifies the specific organization whose data is being accessed or manipulated. Its value depends on the endpoint group and the ownership of the resource.
1. General Organization Data
Endpoint groups: In these groups, the resource owner is the organization identified byorg_id.
- Self:
org_idis your own ID. - Host accessing Guest:
org_idis the Guest’s ID. - Guest accessing Host:
org_idis the Host’s ID. - Requirement:
org_idmust exactly match theTarget-Organization-IDheader.
2. Host-Owned Resources
Endpoint groups:- Organization documents;
- Organization document requests;
- Organization analytics;
- Organization metrics.
org_id changes based on who is asking:
Scenario A: Host requesting data about their Guest
If you are a Host looking at your Guest’s analytics or managing their documents:
Requester-Organization-ID: Host ID (Your ID)Target-Organization-ID: Host ID (Your ID, because you own the analytics)org_id(path): Guest ID- Logic: You are targeting your own “analytics engine” to get data about a specific guest from your list.
Requester-Organization-ID: Guest ID (Your ID)Target-Organization-ID: Host ID (The organization that invited you)org_id(path): Guest ID (Must match your own ID)- Constraint: A Guest can only specify their own ID in the path. You cannot access data about other guests of the same Host.
Headers
Requester-Organization-ID
The organization that makes the request.
- Always set to your organization ID;
- The scenario (Guest, Host, or Self) depends on the relationship with the target organization.
Target-Organization-ID
The organization that the request is directed at:
- Self – same value as
Requester-Organization-ID; - Host → Guest – Guest organization ID;
- Guest → Host – Host organization ID.
Not all endpoints require authorization - only those that operate on organization-related data.
Examples
-
Host request: get data of a connected Guest organization
Guest’s organization IDYour API client access tokenYour organization IDGuest’s organization ID
-
Self request: upload a financial file of your organization
Your organization IDYour API client access tokenYour organization IDYour organization IDISO 4217 currencyFinancial File
Errors
During authorization, the following errors may occur:-
organization_being_deleted – The
Requester-Organization-IDorTarget-Organization-IDrefers to an organization that is currently being deleted. -
unsupported_crud_operation – This error occurs when the HTTP method used is not valid for the requested endpoint. It is not a common error but may appear in such cases.
-
access_denied – This indicates that the API client does not have permission to perform the requested action. Possible reasons include:
- Invalid API client credentials.
- No active connection exists between the organizations.
- The API client does not have access to the requested resource or operation.