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.
85%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
In AEH, "access" to an API is granted via a contract: a binding between one of your applications and a specific API instance (e.g., sandbox/production) under a chosen SLA tier. This workflow covers the full consumer-side request flow: discovering the tiers and grant types offered, creating a contract, listing your contracts, and adjusting the SLA tier later.
What you'll build: Active contracts between your applications and the APIs you need, on the right SLA tiers.
Before starting, ensure:
Authentication ready
Portal and application context
targetOrganizationId, portalIdapplicationId (see manage-portal-applications to create one)groupId, assetId, minorVersion, instanceId (see discover-portal-apis Step 3)Tiers define throughput/quota limits and governance rules for an API instance. Some instances require a tier selection; others default to an implicit tier.
What you'll need:
targetOrganizationId, portalIdgroupId, assetId, minorVersion, instanceIdapi: urn:api:api-experience-hub-consumer
operationId: getTiers
inputs:
targetOrganizationId:
userProvided: true
description: Anypoint organization ID hosting the portal
portalId:
userProvided: true
description: Portal ID the user belongs to
groupId:
userProvided: true
description: Exchange groupId of the target asset
assetId:
userProvided: true
description: Exchange assetId of the target asset
minorVersion:
userProvided: true
description: Minor version the consumer wants access to
instanceId:
userProvided: true
description: API instance ID (environment) to contract against
outputs:
- name: tiers
path: $.tiers[*]
labels: $.tiers[*].name
description: SLA tiers offered on this instance
- name: tierId
path: $.tiers[*].id
description: Tier ID passed to the create-contract callGrant types (client_credentials, authorization_code, etc.) describe how your application will obtain tokens. Some APIs require that at least one grant type matches between API and application.
What you'll need:
targetOrganizationId, portalId, instanceIdapi: urn:api:api-experience-hub-consumer
operationId: getGrantTypesByInstanceId
inputs:
targetOrganizationId:
from:
variable: targetOrganizationId
description: Anypoint organization ID hosting the portal
portalId:
from:
variable: portalId
description: Portal ID
instanceId:
from:
variable: instanceId
description: API instance ID
outputs:
- name: instanceGrantTypes
path: $.grantTypes[*]
description: Grant types the instance supportsCross-check your application's supported grant types against the instance's.
What you'll need:
targetOrganizationId, portalId, applicationIdapi: urn:api:api-experience-hub-consumer
operationId: getGrantTypesByApplicationId
inputs:
targetOrganizationId:
from:
variable: targetOrganizationId
description: Anypoint organization ID hosting the portal
portalId:
from:
variable: portalId
description: Portal ID
applicationId:
userProvided: true
description: ID of the application that will hold the contract
outputs:
- name: applicationGrantTypes
path: $.grantTypes[*]
description: Grant types the application can useWhat happens next: Confirm at least one grant type overlaps between Step 2 and Step 3 before creating the contract.
Bind the application to the API instance under the chosen tier.
What you'll need:
targetOrganizationId, portalIdgroupId, assetId, minorVersionapplicationId, optional tierIdapi: urn:api:api-experience-hub-consumer
operationId: createContract
inputs:
targetOrganizationId:
from:
variable: targetOrganizationId
description: Anypoint organization ID hosting the portal
portalId:
from:
variable: portalId
description: Portal ID
groupId:
from:
variable: groupId
description: Exchange groupId of the target asset
assetId:
from:
variable: assetId
description: Exchange assetId of the target asset
minorVersion:
from:
variable: minorVersion
description: Minor version for the contract
contractRequest:
userProvided: true
description: Contract payload (application, tier, optional custom fields)
example:
applicationId: a1b2c3d4-0000-0000-0000-000000000000
tierId: 12345
acceptedTerms: true
outputs:
- name: contractId
path: $.id
description: The newly created contract ID (may be PENDING until approved)
- name: contractStatus
path: $.status
description: Current status — typically APPROVED or PENDINGWhat happens next: If the API requires admin approval, the contract is PENDING. Otherwise it is immediately APPROVED and the application can call the API.
Audit which APIs a specific application currently has (or has requested) access to.
What you'll need:
targetOrganizationId, portalId, applicationIdapi: urn:api:api-experience-hub-consumer
operationId: getContractsByApplicationId
inputs:
targetOrganizationId:
from:
variable: targetOrganizationId
description: Anypoint organization ID hosting the portal
portalId:
from:
variable: portalId
description: Portal ID
applicationId:
from:
variable: applicationId
description: Application to audit
outputs:
- name: applicationContracts
path: $.contracts[*]
labels: $.contracts[*].assetName
description: Contracts held by this application
- name: contractIds
path: $.contracts[*].id
description: Contract IDs for deeper inspectionRetrieve the full state of one contract — useful to verify status, tier, and SLA usage.
What you'll need:
targetOrganizationId, portalId, applicationId, contractIdapi: urn:api:api-experience-hub-consumer
operationId: getContract
inputs:
targetOrganizationId:
from:
variable: targetOrganizationId
description: Anypoint organization ID hosting the portal
portalId:
from:
variable: portalId
description: Portal ID
applicationId:
from:
variable: applicationId
description: Application holding the contract
contractId:
from:
variable: contractIds
description: Specific contract ID
outputs:
- name: contractDetails
path: $
description: Full contract details (status, tier, associated asset/instance)Upgrade or downgrade the SLA tier — e.g., from Bronze to Gold as consumption grows.
What you'll need:
targetOrganizationId, portalId, applicationId, contractIdtierId chosen from Step 1api: urn:api:api-experience-hub-consumer
operationId: assignSlaTierToContract
inputs:
targetOrganizationId:
from:
variable: targetOrganizationId
description: Anypoint organization ID hosting the portal
portalId:
from:
variable: portalId
description: Portal ID
applicationId:
from:
variable: applicationId
description: Application holding the contract
contractId:
from:
variable: contractIds
description: Contract whose tier is changing
tierId:
from:
variable: tierId
description: New SLA tier ID
outputs:
- name: updatedContractId
path: $.id
description: Contract ID confirmed with the new tier appliedWhat happens next: Depending on portal policy, the new tier may apply immediately or wait for admin approval.
✅ Active Contract(s) — Your applications are bound to the APIs you need on the correct SLA tiers, with grant types that match.
clientId / clientSecret (from manage-portal-applications) to obtain tokens per the chosen grant type.mulesoft/mulesoft-dx
4340d6c
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.