Skip to content

Instantly share code, notes, and snippets.

@chamilaadhi
Created April 21, 2026 05:24
Show Gist options
  • Select an option

  • Save chamilaadhi/ebf36336a073f78d9ad6409622aad76f to your computer and use it in GitHub Desktop.

Select an option

Save chamilaadhi/ebf36336a073f78d9ad6409622aad76f to your computer and use it in GitHub Desktop.

WSO2 API Developer Portal CLI Reference (AP)

ap is a command-line tool for managing and interacting with the WSO2 API Platform. This document covers all Developer Portal sub-commands.

Supported Short Flags

Flag Short Flag
--org -O
--display-name -n
--file -f
--output -o
--version -v
--server -s

Developer Portal Sub Commands

Note: Each command supports the --help flag for detailed usage information.

Prerequisites for Developer Portal Commands

  • You must configure a Developer Portal server in the CLI using the appropriate commands (see server setup below).
  • Credentials can be supplied via configuration or environment variables. Environment variables take precedence over configuration.
  • Export the following environment variables to authenticate:
    export WSO2AP_DP_SERVER=<devportal-base-url>
    export WSO2AP_DP_TOKEN=<bearer-token>

Organizations

1. Create an Organization

CLI Command

ap devportal org create \
  --display-name <name> \
  --org-handle <handle> \
  [--business-owner <name>] \
  [--business-owner-contact <phone>] \
  [--business-owner-email <email>] \
  [--role-claim-name <claim>] \
  [--groups-claim-name <claim>] \
  [--org-claim-name <claim>] \
  [--org-identifier <identifier>] \
  [--admin-role <role>] \
  [--subscriber-role <role>]

Sample Commands

# Minimal organization creation
ap devportal org create --display-name "Acme Corp" --org-handle acme

# Full organization creation
ap devportal org create \
  --display-name "Acme Corp" \
  --org-handle acme \
  --business-owner "Jane Doe" \
  --business-owner-email jane@acme.com \
  --admin-role admin \
  --subscriber-role subscriber

2. List Organizations

CLI Command

ap devportal org list [--output <json|yaml|table>]

Sample Command

ap devportal org list
ap devportal org list --output json

3. Get an Organization

CLI Command

ap devportal org get --org <orgId> [--output <json|yaml>]

Sample Command

ap devportal org get --org f1a2b3c4-0000-0000-0000-000000000001
ap devportal org get --org f1a2b3c4-0000-0000-0000-000000000001 --output yaml

4. Update an Organization

CLI Command

ap devportal org update --org <orgId> \
  [--display-name <name>] \
  [--org-handle <handle>] \
  [--business-owner <name>] \
  [--business-owner-contact <phone>] \
  [--business-owner-email <email>] \
  [--admin-role <role>] \
  [--subscriber-role <role>]

Sample Command

ap devportal org update --org f1a2b3c4-0000-0000-0000-000000000001 \
  --display-name "Acme Corp Updated" \
  --business-owner-email newowner@acme.com

5. Delete an Organization

CLI Command

ap devportal org delete --org <orgId>

Sample Command

ap devportal org delete --org f1a2b3c4-0000-0000-0000-000000000001

Identity Provider

6. Create an Identity Provider

CLI Command

ap devportal idp create --org <orgId> \
  --display-name <name> \
  --issuer <issuerURL> \
  --authorization-url <url> \
  --token-url <url> \
  --client-id <clientId> \
  --callback-url <url> \
  --scope <scope> \
  --logout-url <url> \
  --logout-redirect-uri <uri> \
  [--userinfo-url <url>] \
  [--signup-url <url>] \
  [--jwks-url <url>] \
  [--certificate <pemFile>]

Sample Commands

# Basic identity provider
ap devportal idp create --org f1a2b3c4-0000-0000-0000-000000000001 \
  --display-name "Asgardeo" \
  --issuer https://api.asgardeo.io/t/acme/oauth2/token \
  --authorization-url https://api.asgardeo.io/t/acme/oauth2/authorize \
  --token-url https://api.asgardeo.io/t/acme/oauth2/token \
  --client-id d3f1e2a4-0000-0000-0000-000000000099 \
  --callback-url https://devportal.acme.com/callback \
  --scope "openid profile email" \
  --logout-url https://api.asgardeo.io/t/acme/oidc/logout \
  --logout-redirect-uri https://devportal.acme.com

7. Get Identity Provider

CLI Command

ap devportal idp get --org <orgId> [--output <json|yaml>]

Sample Command

ap devportal idp get --org f1a2b3c4-0000-0000-0000-000000000001
ap devportal idp get --org f1a2b3c4-0000-0000-0000-000000000001 --output yaml

8. Update an Identity Provider

CLI Command

ap devportal idp update --org <orgId> \
  [--issuer <url>] \
  [--client-id <clientId>] \
  [--scope <scope>] \
  [--jwks-url <url>]

Sample Command

ap devportal idp update --org f1a2b3c4-0000-0000-0000-000000000001 \
  --scope "openid profile email groups"

9. Delete Identity Provider

CLI Command

ap devportal idp delete --org <orgId>

Sample Command

ap devportal idp delete --org f1a2b3c4-0000-0000-0000-000000000001

Organization Content (View Layouts)

10. Upload View Layout

CLI Command

ap devportal content upload --org <orgId> --view <viewName> --file <zipPath>

Sample Command

ap devportal content upload \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --view default \
  --file ./my-theme.zip

11. Get View Layout Assets

CLI Command

ap devportal content get --org <orgId> --view <viewName> \
  [--file-type <type>] \
  [--file-name <name>] \
  [--output <path>]

Sample Commands

# List all assets for a view
ap devportal content get --org f1a2b3c4-0000-0000-0000-000000000001 --view default

# Download a specific file type
ap devportal content get \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --view default \
  --file-type image \
  --file-name logo.png \
  --output ./downloads/logo.png

12. Delete View Layout Content

CLI Command

ap devportal content delete --org <orgId> --view <viewName>

Sample Command

ap devportal content delete --org f1a2b3c4-0000-0000-0000-000000000001 --view default

Views

13. Create a View

CLI Command

ap devportal view create --org <orgId> \
  --display-name <name> \
  --name <viewName> \
  [--labels <label1,label2,...>]

Sample Commands

ap devportal view create \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --name premium \
  --display-name "Premium APIs" \
  --labels finance,healthcare

14. List Views

CLI Command

ap devportal view list --org <orgId> [--output <json|yaml|table>]

Sample Command

ap devportal view list --org f1a2b3c4-0000-0000-0000-000000000001

15. Get a View

CLI Command

ap devportal view get --org <orgId> --name <viewName> [--output <json|yaml>]

Sample Command

ap devportal view get --org f1a2b3c4-0000-0000-0000-000000000001 --name premium

16. Update a View

CLI Command

ap devportal view update --org <orgId> --name <viewName> \
  [--display-name <name>] \
  [--labels <label1,label2,...>]

Sample Command

ap devportal view update \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --name premium \
  --labels finance,healthcare,insurance

17. Delete a View

CLI Command

ap devportal view delete --org <orgId> --name <viewName>

Sample Command

ap devportal view delete --org f1a2b3c4-0000-0000-0000-000000000001 --name premium

Labels

18. Create Labels

CLI Command

ap devportal label create --org <orgId> --name <name> --display-name <displayName>

Sample Command

ap devportal label create \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --name finance \
  --display-name "Finance APIs"

19. List Labels

CLI Command

ap devportal label list --org <orgId> [--output <json|yaml|table>]

Sample Command

ap devportal label list --org f1a2b3c4-0000-0000-0000-000000000001

20. Update a Label

CLI Command

ap devportal label update --org <orgId> --name <name> --display-name <displayName>

Sample Command

ap devportal label update \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --name finance \
  --display-name "Financial Services APIs"

21. Delete Labels

CLI Command

ap devportal label delete --org <orgId> --name <name>

Sample Command

ap devportal label delete --org f1a2b3c4-0000-0000-0000-000000000001 --name finance

API Metadata

22. Create an API

CLI Command

ap devportal api create --org <orgId> \
  --file <apiMetadataJson> \
  [--api-definition <definitionFile>] \
  [--schema-definition <schemaFile>]

The --file flag accepts a JSON file with the API metadata. The --api-definition flag accepts an OpenAPI/AsyncAPI/GraphQL/WSDL file. The --schema-definition flag is required for GraphQL APIs.

API Metadata JSON Example

{
  "apiInfo": {
    "apiName": "PetStore API",
    "apiVersion": "1.0.0",
    "apiDescription": "A sample API for managing pets",
    "apiType": "REST",
    "visibility": "PUBLIC",
    "gatewayVendor": "wso2",
    "gatewayType": "REGULAR",
    "tokenBasedSubscriptionEnabled": true,
    "tags": ["pets", "store"],
    "owners": {
      "technicalOwner": "techteam@acme.com",
      "businessOwner": "business@acme.com"
    }
  },
  "endPoints": {
    "productionURL": "https://api.acme.com/petstore/v1",
    "sandboxURL": "https://sandbox.acme.com/petstore/v1"
  },
  "monetizationInfo": {
    "enabled": false
  }
}

Sample Commands

# Create with metadata only
ap devportal api create \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --file petstore-metadata.json

# Create with API definition file
ap devportal api create \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --file petstore-metadata.json \
  --api-definition petstore-openapi.yaml

# Create a GraphQL API with schema
ap devportal api create \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --file graphql-metadata.json \
  --api-definition schema.graphql \
  --schema-definition schema.graphql

23. List APIs

CLI Command

ap devportal api list --org <orgId> \
  [--query <searchText>] \
  [--api-name <name>] \
  [--version <version>] \
  [--tags <tag1,tag2>] \
  [--groups <group1,group2>] \
  [--view <viewName>] \
  [--output <json|yaml|table>]

Sample Commands

# List all APIs
ap devportal api list --org f1a2b3c4-0000-0000-0000-000000000001

# Search APIs by name
ap devportal api list --org f1a2b3c4-0000-0000-0000-000000000001 --api-name PetStore

# Filter by tag and view
ap devportal api list \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --tags finance \
  --view premium \
  --output table

24. Get an API

CLI Command

ap devportal api get --org <orgId> --id <apiId> [--output <json|yaml>]

Sample Command

ap devportal api get \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --id a1b2c3d4-0000-0000-0000-000000000010 \
  --output yaml

25. Update an API

CLI Command

ap devportal api update --org <orgId> --id <apiId> \
  --file <apiMetadataJson> \
  [--api-definition <definitionFile>] \
  [--schema-definition <schemaFile>]

Sample Command

ap devportal api update \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --id a1b2c3d4-0000-0000-0000-000000000010 \
  --file petstore-metadata-v2.json \
  --api-definition petstore-openapi-v2.yaml

26. Delete an API

CLI Command

ap devportal api delete --org <orgId> --id <apiId>

Sample Command

ap devportal api delete \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --id a1b2c3d4-0000-0000-0000-000000000010

API Templates

27. Upload an API Template

CLI Command

ap devportal api template upload --org <orgId> --id <apiId> --file <zipPath>

Sample Command

ap devportal api template upload \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --id a1b2c3d4-0000-0000-0000-000000000010 \
  --file petstore-content.zip

28. Download an API Template

CLI Command

ap devportal api template get --org <orgId> --id <apiId> --output <path>

Sample Command

ap devportal api template get \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --id a1b2c3d4-0000-0000-0000-000000000010 \
  --output ./petstore-template.zip

29. Delete an API Template

CLI Command

ap devportal api template delete --org <orgId> --id <apiId>

Sample Command

ap devportal api template delete \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --id a1b2c3d4-0000-0000-0000-000000000010

Subscription Policies

30. Add Subscription Policies

CLI Command

ap devportal policy create --org <orgId> \
  --name <policyName> \
  --display-name <displayName> \
  [--description <description>] \
  [--request-count <count>] \
  [--billing-plan <plan>] \
  [--pricing-model <model>] \
  [--currency <currency>] \
  [--billing-period <period>] \
  [--flat-amount <amount>] \
  [--unit-amount <amount>]

Sample Commands

# Free tier policy
ap devportal policy create \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --name free \
  --display-name "Free Tier" \
  --request-count 1000 \
  --billing-plan FREE

# Paid policy
ap devportal policy create \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --name gold \
  --display-name "Gold Plan" \
  --request-count 100000 \
  --billing-plan COMMERCIAL \
  --pricing-model FLAT \
  --currency USD \
  --billing-period MONTHLY \
  --flat-amount 49.99

31. Get a Subscription Policy

CLI Command

ap devportal policy get --org <orgId> --id <policyId> [--output <json|yaml>]

Sample Command

ap devportal policy get \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --id p1b2c3d4-0000-0000-0000-000000000020

32. Update Subscription Policies

CLI Command

ap devportal policy update --org <orgId> \
  --name <policyName> \
  [--display-name <displayName>] \
  [--request-count <count>] \
  [--flat-amount <amount>]

Sample Command

ap devportal policy update \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --name gold \
  --flat-amount 59.99

33. Delete a Subscription Policy

CLI Command

ap devportal policy delete --org <orgId> --name <policyName>

Sample Command

ap devportal policy delete \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --name gold

Applications

34. Create an Application

CLI Command

ap devportal app create --org <orgId> \
  --display-name <name> \
  [--description <description>] \
  [--type <type>]

Sample Command

ap devportal app create \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --display-name "My Mobile App" \
  --description "Mobile app for customer self-service" \
  --type WEB

35. List Applications

CLI Command

ap devportal app list --org <orgId> [--output <json|yaml|table>]

Sample Command

ap devportal app list --org f1a2b3c4-0000-0000-0000-000000000001
ap devportal app list --org f1a2b3c4-0000-0000-0000-000000000001 --output table

36. Get an Application

CLI Command

ap devportal app get --org <orgId> --id <appId> [--output <json|yaml>]

Sample Command

ap devportal app get \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --id b2c3d4e5-0000-0000-0000-000000000030

37. Update an Application

CLI Command

ap devportal app update --org <orgId> --id <appId> \
  [--display-name <name>] \
  [--description <description>] \
  [--type <type>]

Sample Command

ap devportal app update \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --id b2c3d4e5-0000-0000-0000-000000000030 \
  --display-name "My Mobile App v2"

38. Delete an Application

CLI Command

ap devportal app delete --org <orgId> --id <appId>

Sample Command

ap devportal app delete \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --id b2c3d4e5-0000-0000-0000-000000000030

39. Import an Application

CLI Command

ap devportal app import --org <orgId> --file <yamlFile> \
  [--with-keys] \
  [--key-manager <keyManagerName>]

Sample Command

ap devportal app import \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --file exported-app.yaml \
  --with-keys \
  --key-manager "Resident Key Manager"

Subscriptions

40. Subscribe to an API

CLI Command

ap devportal subscription create --org <orgId> \
  --app-id <appId> \
  --api-id <apiId> \
  [--policy-id <policyId>]

Sample Command

ap devportal subscription create \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --app-id b2c3d4e5-0000-0000-0000-000000000030 \
  --api-id a1b2c3d4-0000-0000-0000-000000000010 \
  --policy-id p1b2c3d4-0000-0000-0000-000000000020

41. List Subscriptions

CLI Command

ap devportal subscription list --org <orgId> [--output <json|yaml|table>]

Sample Command

ap devportal subscription list --org f1a2b3c4-0000-0000-0000-000000000001

42. Get a Subscription

CLI Command

ap devportal subscription get --org <orgId> --id <subscriptionId> [--output <json|yaml>]

Sample Command

ap devportal subscription get \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --id s1a2b3c4-0000-0000-0000-000000000040

43. Delete a Subscription

CLI Command

ap devportal subscription delete --org <orgId> --id <subscriptionId>

Sample Command

ap devportal subscription delete \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --id s1a2b3c4-0000-0000-0000-000000000040

44. Unsubscribe from an API

CLI Command

ap devportal subscription unsubscribe --org <orgId> --api-id <apiId> --app-id <appId>

Sample Command

ap devportal subscription unsubscribe \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --api-id a1b2c3d4-0000-0000-0000-000000000010 \
  --app-id b2c3d4e5-0000-0000-0000-000000000030

Platform Gateway Subscriptions

45. Create a Platform Subscription

CLI Command

ap devportal platform-subscription create --org <orgId> \
  --api-id <apiId> \
  [--plan <subscriptionPlanName>] \
  [--app-id <applicationId>]

Sample Command

ap devportal platform-subscription create \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --api-id a1b2c3d4-0000-0000-0000-000000000010 \
  --plan Gold

46. List Platform Subscriptions

CLI Command

ap devportal platform-subscription list --org <orgId> \
  [--api-id <apiId>] \
  [--output <json|yaml|table>]

Sample Command

ap devportal platform-subscription list --org f1a2b3c4-0000-0000-0000-000000000001
ap devportal platform-subscription list \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --api-id a1b2c3d4-0000-0000-0000-000000000010

47. Get a Platform Subscription

CLI Command

ap devportal platform-subscription get --org <orgId> --id <subscriptionId> [--output <json|yaml>]

Sample Command

ap devportal platform-subscription get \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --id ps1a2b3c-0000-0000-0000-000000000050

48. Update a Platform Subscription

CLI Command

ap devportal platform-subscription update --org <orgId> --id <subscriptionId> \
  --status <ACTIVE|INACTIVE>

Sample Command

ap devportal platform-subscription update \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --id ps1a2b3c-0000-0000-0000-000000000050 \
  --status INACTIVE

49. Delete a Platform Subscription

CLI Command

ap devportal platform-subscription delete --org <orgId> --id <subscriptionId>

Sample Command

ap devportal platform-subscription delete \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --id ps1a2b3c-0000-0000-0000-000000000050

Platform API Keys

50. Generate a Platform API Key

CLI Command

ap devportal platform-api-key generate --org <orgId> \
  --api-id <apiId> \
  --name <keyName> \
  [--expires-at <isoDateTime>]

Note: Key name must match the pattern ^[a-z0-9][a-z0-9_-]{0,127}$.

Sample Commands

# Generate a non-expiring key
ap devportal platform-api-key generate \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --api-id a1b2c3d4-0000-0000-0000-000000000010 \
  --name my-service-key

# Generate a key that expires
ap devportal platform-api-key generate \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --api-id a1b2c3d4-0000-0000-0000-000000000010 \
  --name temp-key \
  --expires-at "2026-12-31T23:59:59+00:00"

51. List Platform API Keys

CLI Command

ap devportal platform-api-key list --org <orgId> --api-id <apiId> [--output <json|yaml|table>]

Sample Command

ap devportal platform-api-key list \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --api-id a1b2c3d4-0000-0000-0000-000000000010

52. Regenerate a Platform API Key

CLI Command

ap devportal platform-api-key regenerate --org <orgId> --key-id <apiKeyId> \
  --api-id <apiId> \
  --name <keyName> \
  [--expires-at <isoDateTime>]

Sample Command

ap devportal platform-api-key regenerate \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --key-id k1a2b3c4-0000-0000-0000-000000000060 \
  --api-id a1b2c3d4-0000-0000-0000-000000000010 \
  --name my-service-key

53. Revoke a Platform API Key

CLI Command

ap devportal platform-api-key revoke --org <orgId> --key-id <apiKeyId> --api-id <apiId>

Sample Command

ap devportal platform-api-key revoke \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --key-id k1a2b3c4-0000-0000-0000-000000000060 \
  --api-id a1b2c3d4-0000-0000-0000-000000000010

OAuth Keys & Tokens

54. Generate OAuth Application Keys

CLI Command

ap devportal app keys generate --org <orgId> --app-id <applicationId> \
  --key-type <PRODUCTION|SANDBOX> \
  --grant-types <type1,type2>

Sample Commands

ap devportal app keys generate \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --app-id b2c3d4e5-0000-0000-0000-000000000030 \
  --key-type PRODUCTION \
  --grant-types "client_credentials,authorization_code"

55. Generate an OAuth Token

CLI Command

ap devportal app keys token --org <orgId> --app-id <applicationId> \
  --key-mapping-id <keyMappingId> \
  --grant-types <type1,type2> \
  [--validity-period <seconds>]

Sample Command

ap devportal app keys token \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --app-id b2c3d4e5-0000-0000-0000-000000000030 \
  --key-mapping-id km1a2b3c-0000-0000-0000-000000000070 \
  --grant-types client_credentials \
  --validity-period 3600

56. Update OAuth Key Mapping

CLI Command

ap devportal app keys update --org <orgId> --app-id <applicationId> \
  --key-mapping-id <keyMappingId> \
  --grant-types <type1,type2> \
  [--validity-period <seconds>]

Sample Command

ap devportal app keys update \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --app-id b2c3d4e5-0000-0000-0000-000000000030 \
  --key-mapping-id km1a2b3c-0000-0000-0000-000000000070 \
  --grant-types "client_credentials,refresh_token"

57. Revoke OAuth Key Mapping

CLI Command

ap devportal app keys revoke --org <orgId> --app-id <applicationId> \
  --key-mapping-id <keyMappingId>

Sample Command

ap devportal app keys revoke \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --app-id b2c3d4e5-0000-0000-0000-000000000030 \
  --key-mapping-id km1a2b3c-0000-0000-0000-000000000070

Standalone API Keys

58. Generate an API Key

CLI Command

ap devportal api-key generate \
  --api-id <apiId> \
  [--app-id <applicationId>] \
  [--key-type <keyType>] \
  [--plan <subscriptionPlan>]

Sample Command

ap devportal api-key generate \
  --api-id a1b2c3d4-0000-0000-0000-000000000010 \
  --app-id b2c3d4e5-0000-0000-0000-000000000030 \
  --key-type PRODUCTION

59. Revoke an API Key

CLI Command

ap devportal api-key revoke --id <apiKeyId>

Sample Command

ap devportal api-key revoke --id k1a2b3c4-0000-0000-0000-000000000080

60. Regenerate an API Key

CLI Command

ap devportal api-key regenerate --id <apiKeyId>

Sample Command

ap devportal api-key regenerate --id k1a2b3c4-0000-0000-0000-000000000080

SDK Generation

61. Generate an SDK

CLI Command

ap devportal sdk generate --org <orgId> --app-id <applicationId> \
  --apis <apiId1,apiId2,...> \
  [--language <language>] \
  [--output <path>]

Sample Commands

# Generate a TypeScript SDK
ap devportal sdk generate \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --app-id b2c3d4e5-0000-0000-0000-000000000030 \
  --apis a1b2c3d4-0000-0000-0000-000000000010 \
  --language typescript \
  --output ./sdk

# Generate a Python SDK for multiple APIs
ap devportal sdk generate \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --app-id b2c3d4e5-0000-0000-0000-000000000030 \
  --apis a1b2c3d4-0000-0000-0000-000000000010,a2b3c4d5-0000-0000-0000-000000000011 \
  --language python \
  --output ./sdk

62. Check SDK Generation Job Progress

CLI Command

ap devportal sdk status --app-id <applicationId> --job-id <jobId>

Sample Command

ap devportal sdk status \
  --app-id b2c3d4e5-0000-0000-0000-000000000030 \
  --job-id j1a2b3c4-0000-0000-0000-000000000090

63. Cancel an SDK Generation Job

CLI Command

ap devportal sdk cancel --app-id <applicationId> --job-id <jobId>

Sample Command

ap devportal sdk cancel \
  --app-id b2c3d4e5-0000-0000-0000-000000000030 \
  --job-id j1a2b3c4-0000-0000-0000-000000000090

64. Download a Generated SDK

CLI Command

ap devportal sdk download --filename <filename> --output <path>

Sample Command

ap devportal sdk download \
  --filename petstore-sdk-ts-20260421.zip \
  --output ./downloads/petstore-sdk.zip

Billing

65. Get Billing Usage Data

CLI Command

ap devportal billing usage --org <orgId> [--output <json|yaml>]

Sample Command

ap devportal billing usage --org f1a2b3c4-0000-0000-0000-000000000001

66. Get Payment Methods

CLI Command

ap devportal billing payment-methods --org <orgId> [--output <json|yaml|table>]

Sample Command

ap devportal billing payment-methods --org f1a2b3c4-0000-0000-0000-000000000001

67. Get Billing Info

CLI Command

ap devportal billing info --org <orgId> [--output <json|yaml>]

Sample Command

ap devportal billing info --org f1a2b3c4-0000-0000-0000-000000000001

68. Get Active Billing Subscriptions

CLI Command

ap devportal billing subscriptions --org <orgId> [--output <json|yaml|table>]

Sample Command

ap devportal billing subscriptions --org f1a2b3c4-0000-0000-0000-000000000001

69. Configure Billing Engine Keys

CLI Command

ap devportal billing keys add --org <orgId> --file <keysJson>
ap devportal billing keys update --org <orgId> --file <keysJson>
ap devportal billing keys get --org <orgId> [--output <json|yaml>]
ap devportal billing keys delete --org <orgId>

Sample Commands

ap devportal billing keys add \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --file stripe-keys.json

ap devportal billing keys get \
  --org f1a2b3c4-0000-0000-0000-000000000001

70. Create a Checkout Session

CLI Command

ap devportal billing checkout --org <orgId> --file <checkoutParamsJson>

Sample Command

ap devportal billing checkout \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --file checkout-params.json

71. Get Subscription Billing Status

CLI Command

ap devportal billing subscription-status --org <orgId> --sub-id <subscriptionId>

Sample Command

ap devportal billing subscription-status \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --sub-id stripe-sub-abc123

72. Cancel a Billing Subscription

CLI Command

ap devportal billing cancel-subscription --org <orgId> --sub-id <subscriptionId>

Sample Command

ap devportal billing cancel-subscription \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --sub-id stripe-sub-abc123

Usage

73. Get Subscription Usage

CLI Command

ap devportal usage get --org <orgId> --sub-id <subscriptionId> [--output <json|yaml>]

Sample Command

ap devportal usage get \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --sub-id stripe-sub-abc123

Invoices

74. List Invoices

CLI Command

ap devportal invoice list --org <orgId> [--output <json|yaml|table>]

Sample Command

ap devportal invoice list --org f1a2b3c4-0000-0000-0000-000000000001

75. Get an Invoice

CLI Command

ap devportal invoice get --org <orgId> --id <invoiceId> [--output <json|yaml>]

Sample Command

ap devportal invoice get \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --id inv-abc12345

76. List Invoices by Subscription

CLI Command

ap devportal invoice list --org <orgId> --sub-id <subscriptionId> [--output <json|yaml|table>]

Sample Command

ap devportal invoice list \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --sub-id stripe-sub-abc123

77. Get Invoice PDF Link

CLI Command

ap devportal invoice pdf --org <orgId> --id <invoiceId>

Sample Command

ap devportal invoice pdf \
  --org f1a2b3c4-0000-0000-0000-000000000001 \
  --id inv-abc12345

Authentication

78. Login

CLI Command

ap devportal login --username <username>

Note: You will be prompted for your password interactively. Alternatively, export WSO2AP_DP_PASSWORD=<password> to avoid the interactive prompt (not recommended for shared environments).

Sample Command

ap devportal login --username admin@acme.com

Command Summary

# Command Description
1 ap devportal org create Create an organization
2 ap devportal org list List all organizations
3 ap devportal org get Get an organization
4 ap devportal org update Update an organization
5 ap devportal org delete Delete an organization
6 ap devportal idp create Create identity provider
7 ap devportal idp get Get identity provider
8 ap devportal idp update Update identity provider
9 ap devportal idp delete Delete identity provider
10 ap devportal content upload Upload view layout (zip)
11 ap devportal content get Get view layout assets
12 ap devportal content delete Delete view layout
13 ap devportal view create Create a view
14 ap devportal view list List views
15 ap devportal view get Get a view
16 ap devportal view update Update a view
17 ap devportal view delete Delete a view
18 ap devportal label create Create a label
19 ap devportal label list List labels
20 ap devportal label update Update a label
21 ap devportal label delete Delete a label
22 ap devportal api create Create an API
23 ap devportal api list List APIs
24 ap devportal api get Get an API
25 ap devportal api update Update an API
26 ap devportal api delete Delete an API
27 ap devportal api template upload Upload API template
28 ap devportal api template get Download API template
29 ap devportal api template delete Delete API template
30 ap devportal policy create Add subscription policy
31 ap devportal policy get Get subscription policy
32 ap devportal policy update Update subscription policy
33 ap devportal policy delete Delete subscription policy
34 ap devportal app create Create an application
35 ap devportal app list List applications
36 ap devportal app get Get an application
37 ap devportal app update Update an application
38 ap devportal app delete Delete an application
39 ap devportal app import Import an application
40 ap devportal subscription create Subscribe to an API
41 ap devportal subscription list List subscriptions
42 ap devportal subscription get Get a subscription
43 ap devportal subscription delete Delete a subscription
44 ap devportal subscription unsubscribe Unsubscribe from an API
45 ap devportal platform-subscription create Create platform subscription
46 ap devportal platform-subscription list List platform subscriptions
47 ap devportal platform-subscription get Get platform subscription
48 ap devportal platform-subscription update Update platform subscription
49 ap devportal platform-subscription delete Delete platform subscription
50 ap devportal platform-api-key generate Generate platform API key
51 ap devportal platform-api-key list List platform API keys
52 ap devportal platform-api-key regenerate Regenerate platform API key
53 ap devportal platform-api-key revoke Revoke platform API key
54 ap devportal app keys generate Generate OAuth app keys
55 ap devportal app keys token Generate OAuth token
56 ap devportal app keys update Update OAuth key mapping
57 ap devportal app keys revoke Revoke OAuth key mapping
58 ap devportal api-key generate Generate standalone API key
59 ap devportal api-key revoke Revoke standalone API key
60 ap devportal api-key regenerate Regenerate standalone API key
61 ap devportal sdk generate Start SDK generation job
62 ap devportal sdk status Check SDK generation progress
63 ap devportal sdk cancel Cancel SDK generation job
64 ap devportal sdk download Download generated SDK
65 ap devportal billing usage Get billing usage data
66 ap devportal billing payment-methods Get payment methods
67 ap devportal billing info Get billing info
68 ap devportal billing subscriptions Get active billing subscriptions
69 ap devportal billing keys Manage billing engine keys
70 ap devportal billing checkout Create checkout session
71 ap devportal billing subscription-status Get subscription billing status
72 ap devportal billing cancel-subscription Cancel billing subscription
73 ap devportal usage get Get subscription usage
74 ap devportal invoice list List invoices
75 ap devportal invoice get Get an invoice
76 ap devportal invoice list --sub-id List invoices by subscription
77 ap devportal invoice pdf Get invoice PDF link
78 ap devportal login Login to the developer portal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment