Back to Content Management API

contentReleaseCreate

Creates an open content release. To stage changes in the release, send its ID in the X-Pack-Release-Id header on content reads and writes.

Arguments

  • Name
    input
    Type
    ContentReleaseCreateInput!
    Description

    An object.

    • name: String!
    • description: String

Returns

Request

import { PackClient } from '@pack/client'
const packClient = new PackClient({
  token: 'YOUR-PACK-TOKEN',
})

const query = `
  mutation ContentReleaseCreate($input: ContentReleaseCreateInput!) {
    contentReleaseCreate(input: $input) {
      id
      name
      handle
      status
    }
  }
`
const variables = {
  input: {
    name: 'Holiday launch',
    description: 'Homepage and PDP updates for the holiday sale',
  },
}
const response = await packClient.fetch(query, { variables })
console.log(response.data)

Response

{
  "data": {
    "contentReleaseCreate": {
      "id": "release-id",
      "name": "Holiday launch",
      "handle": "holiday-launch",
      "status": "open"
    }
  }
}

Was this page helpful?