Skip to content

Update an existing subscription

PUT /api/v1/update-subscription/{name}

PUT /maas/api/v1/update-subscription/{name}

Updates an existing MaaSSubscription and its associated MaaSAuthPolicy. K8s calls: PUT /k8s/v1/maassubscription/:name, PUT /k8s/v1/maasauthpolicy/:name

Authorization

Parameters

Name In Type Required Description
name path string Yes

Name of the MaaSSubscription to update

Request body

Required.

Content type: application/json

Schema: UpdateSubscriptionRequest

Example:

{
  "owner": {
    "groups": [
      {
        "name": "premium-users"
      },
      {
        "name": "beta-testers"
      }
    ]
  },
  "modelRefs": [
    {
      "name": "llama-2-7b-chat",
      "namespace": "maas-models",
      "tokenRateLimits": [
        {
          "limit": 200000,
          "window": "24h"
        }
      ]
    },
    {
      "name": "mistral-7b-instruct",
      "namespace": "maas-models",
      "tokenRateLimits": [
        {
          "limit": 300000,
          "window": "24h"
        }
      ]
    }
  ],
  "tokenMetadata": {
    "organizationId": "org-123",
    "costCenter": "engineering-v2"
  },
  "inferencePriority": 20
}

Responses

Status Description Response body
200 OK

Subscription and auth policy updated successfully

CreateSubscriptionResponse

application/json

400 Bad Request

Bad Request. Invalid update specification.

ErrorResponse

application/json

401 Unauthorized

Unauthorized

None
403 Forbidden

Forbidden

None
404 Not Found

Subscription not found

ErrorResponse

application/json

500 Internal Server Error

Internal Server Error

ErrorResponse

application/json

Example request

curl -X PUT "/maas/api/v1/update-subscription/{name}" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "owner": {
    "groups": [
      {
        "name": "premium-users"
      },
      {
        "name": "beta-testers"
      }
    ]
  },
  "modelRefs": [
    {
      "name": "llama-2-7b-chat",
      "namespace": "maas-models",
      "tokenRateLimits": [
        {
          "limit": 200000,
          "window": "24h"
        }
      ]
    },
    {
      "name": "mistral-7b-instruct",
      "namespace": "maas-models",
      "tokenRateLimits": [
        {
          "limit": 300000,
          "window": "24h"
        }
      ]
    }
  ],
  "tokenMetadata": {
    "organizationId": "org-123",
    "costCenter": "engineering-v2"
  },
  "inferencePriority": 20
}'

Example response

200 OK, application/json

{
  "subscription": {
    "name": "premium-team-sub",
    "namespace": "maas-system",
    "phase": "Active",
    "inferencePriority": 20,
    "owner": {
      "groups": [
        {
          "name": "premium-users"
        },
        {
          "name": "beta-testers"
        }
      ]
    },
    "modelRefs": [
      {
        "name": "llama-2-7b-chat",
        "namespace": "maas-models",
        "tokenRateLimits": [
          {
            "limit": 200000,
            "window": "24h"
          }
        ]
      },
      {
        "name": "mistral-7b-instruct",
        "namespace": "maas-models",
        "tokenRateLimits": [
          {
            "limit": 300000,
            "window": "24h"
          }
        ]
      }
    ],
    "creationTimestamp": "2025-03-01T10:00:00Z"
  },
  "authPolicy": {
    "name": "premium-team-sub-policy",
    "namespace": "maas-system",
    "phase": "Active",
    "modelRefs": [
      {
        "name": "llama-2-7b-chat",
        "namespace": "maas-models"
      },
      {
        "name": "mistral-7b-instruct",
        "namespace": "maas-models"
      }
    ],
    "subjects": {
      "groups": [
        {
          "name": "premium-users"
        },
        {
          "name": "beta-testers"
        }
      ]
    }
  }
}