# request-api-access Request access to a published API in an API Experience Hub portal by creating a contract between one of your applications and a specific API instance/tier. Use when a portal consumer needs to discover available tiers and grant types, create a contract, review existing contracts, or change an SLA tier on an active contract. - **APIs:** [api-experience-hub-consumer](https://dev-portal.mulesoft.com/apis/api-experience-hub-consumer.md)- **Skill Source:** [SKILL.md](https://dev-portal.mulesoft.com/skills/request-api-access/SKILL.md) ## Steps ### Step 1: Step 1: List Available SLA Tiers for an Instance **API:** `urn:api:api-experience-hub-consumer`**Operation:** `getTiers` **Inputs:** - `targetOrganizationId` — Anypoint organization ID hosting the portal - `portalId` — Portal ID the user belongs to - `groupId` — Exchange groupId of the target asset - `assetId` — Exchange assetId of the target asset - `minorVersion` — Minor version the consumer wants access to - `instanceId` — API instance ID (environment) to contract against **Outputs:** - `tiers` (`$.tiers[*]`) — SLA tiers offered on this instance - `tierId` (`$.tiers[*].id`) — Tier ID passed to the create-contract call ### Step 2: Step 2: List Grant Types Offered by the API Instance **API:** `urn:api:api-experience-hub-consumer`**Operation:** `getGrantTypesByInstanceId` **Inputs:** - `targetOrganizationId` — Anypoint organization ID hosting the portal - `portalId` — Portal ID - `instanceId` — API instance ID **Outputs:** - `instanceGrantTypes` (`$.grantTypes[*]`) — Grant types the instance supports ### Step 3: Step 3: List Grant Types Supported by Your Application **API:** `urn:api:api-experience-hub-consumer`**Operation:** `getGrantTypesByApplicationId` **Inputs:** - `targetOrganizationId` — Anypoint organization ID hosting the portal - `portalId` — Portal ID - `applicationId` — ID of the application that will hold the contract **Outputs:** - `applicationGrantTypes` (`$.grantTypes[*]`) — Grant types the application can use ### Step 4: Step 4: Create a Contract **API:** `urn:api:api-experience-hub-consumer`**Operation:** `createContract` **Inputs:** - `targetOrganizationId` — Anypoint organization ID hosting the portal - `portalId` — Portal ID - `groupId` — Exchange groupId of the target asset - `assetId` — Exchange assetId of the target asset - `minorVersion` — Minor version for the contract - `contractRequest` — Contract payload (application, tier, optional custom fields) **Outputs:** - `contractId` (`$.id`) — The newly created contract ID (may be PENDING until approved) - `contractStatus` (`$.status`) — Current status — typically APPROVED or PENDING ### Step 5: Step 5: List Contracts for an Application **API:** `urn:api:api-experience-hub-consumer`**Operation:** `getContractsByApplicationId` **Inputs:** - `targetOrganizationId` — Anypoint organization ID hosting the portal - `portalId` — Portal ID - `applicationId` — Application to audit **Outputs:** - `applicationContracts` (`$.contracts[*]`) — Contracts held by this application - `contractIds` (`$.contracts[*].id`) — Contract IDs for deeper inspection ### Step 6: Step 6: Get Contract Details **API:** `urn:api:api-experience-hub-consumer`**Operation:** `getContract` **Inputs:** - `targetOrganizationId` — Anypoint organization ID hosting the portal - `portalId` — Portal ID - `applicationId` — Application holding the contract - `contractId` — Specific contract ID **Outputs:** - `contractDetails` (`$`) — Full contract details (status, tier, associated asset/instance) ### Step 7: Step 7: Change the SLA Tier on an Active Contract **API:** `urn:api:api-experience-hub-consumer`**Operation:** `assignSlaTierToContract` **Inputs:** - `targetOrganizationId` — Anypoint organization ID hosting the portal - `portalId` — Portal ID - `applicationId` — Application holding the contract - `contractId` — Contract whose tier is changing - `tierId` — New SLA tier ID **Outputs:** - `updatedContractId` (`$.id`) — Contract ID confirmed with the new tier applied