projects

Update an existing project in your workspace, identified by its id.

The project name, slug, and delete protection setting can be changed. Omitted fields are left unchanged. Changing the slug affects the deployment domains generated for this project.

Required Permissions

Your root key must have one of the following permissions:

  • project.*.update_project (to update any project)
  • project.<project_id>.update_project (to update a specific project)
post/v2/projects.updateProject

Request

  • Base URL
    https://api.unkey.com
  • URL
    https://api.unkey.com/v2/projects.updateProject
  • Auth
    HTTP bearer

Request body

projectstring required

Identifies a resource by either its unique ID or its slug. Accepts a prefixed ID (such as 'proj_' or 'app_') or a slug.

slugstring

Identifies a resource by either its unique ID or its slug. Accepts a prefixed ID (such as 'proj_' or 'app_') or a slug.

namestring

New human-readable name for the project. Omit this field to leave the current name unchanged.

deleteProtectionboolean

Enable or disable delete protection for the project. Omit this field to leave the current setting unchanged.

Example request

{
  "project": "proj_1234abcd",
  "slug": "proj_1234abcd",
  "name": "Payments Service",
  "deleteProtection": true
}

Response

Successfully updated the project.

Example response

{
  "meta": {
    "requestId": "req_123"
  },
  "data": {
    "id": "proj_1234abcd",
    "name": "Payments Service",
    "slug": "payments-service",
    "createdAt": 1704067200000,
    "updatedAt": 1704153600000
  }
}

Changes

    • info

      the endpoint scheme security bearer was added to the API

    • info

      the endpoint scheme security rootKey was removed from the API

    • breaking

      added the new required request property

    • breaking

      the request property's maxLength was decreased to 255

    • breaking

      the request property's minLength was increased from 1 to 3

    • warning

      changed the pattern of the request property from ^[a-z0-9]+(-[a-z0-9]+)*$ to ^[a-zA-Z0-9_-]+$

    • warning

      removed the request property