> ## Documentation Index
> Fetch the complete documentation index at: https://docs.appcharge.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Content

> Updates a content item.

<RequestExample>
  ```bash Update Content theme={"system"}
  curl -X PUT \
    'https://api.appcharge.com/v1/portal-content/507f1f77bcf86cd799439011' \
    -H 'Content-Type: application/json' \
    -H 'x-publisher-token: <x-publisher-token>' \
    -d '{
      "title": "New Game: Jelly Soda",
      "state": "visible",
      "labels": ["tutorial", "beginner", "featured"]
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json Update Content theme={"system"}
  {
    "id": "507f1f77bcf86cd799439011",
    "title": "New Game: Jelly Soda",
    "subTitle": "Everything you need to know",
    "bodyText": "This is the main content body with detailed information...",
    "headerImage": "https://cdn.example.com/images/header.jpg",
    "thumbnailImage": "https://media.appcharge.com/media/25cb4861ec8924a6b69a0f59/book-shelf1920.jpg",
    "labels": ["tutorial", "beginner", "featured"],
    "state": "visible",
    "contentType": "article",
    "slug": "welcome-to-our-game",
    "visibility": "public",
    "tag": "spring2025",
    "createdAt": "2025-10-15T10:30:00.000Z",
    "updatedAt": "2025-10-20T14:45:00.000Z",
    "translations": [
      {
        "isoCode": "fr-FR",
        "title": "Bienvenue dans notre jeu",
        "subTitle": "Tout ce que vous devez savoir",
        "bodyText": "Ceci est le contenu principal de l'article en français...",
        "headerImage": "https://cdn.example.com/images/header-fr.jpg",
        "thumbnailImage": "https://media.appcharge.com/media/25cb4861ec8924a6b69a0f59/book-shelf1920.jpg",
        "labels": ["tutoriel", "débutant"]
      }
    ],
    "pages": [
      {
        "id": "6850249eb5bd5c59b9bab7e2",
        "pageName": "FAQs"
      },
      {
        "id": "692eb70d0293e07ab4895518",
        "pageName": "Events"
      }
    ]
  }
  ```

  ```json 400 theme={"system"}
  {
    "message": "BAD_REQUEST",
    "requestUrl": "/v1/portal-content/{contentId}",
    "body": "Invalid request body or validation error."
  }
  ```

  ```json 401 theme={"system"}
  {
    "message": "UNAUTHORIZED",
    "requestUrl": "/v1/portal-content/{contentId}",
    "body": "Invalid or missing publisher token."
  }
  ```

  ```json 404 theme={"system"}
  {
    "message": "NOT_FOUND",
    "requestUrl": "/v1/portal-content/{contentId}",
    "body": "Content not found."
  }
  ```

  ```json 409 theme={"system"}
  {
    "message": "CONFLICT",
    "requestUrl": "/v1/portal-content/{contentId}",
    "body": "Slug already exists."
  }
  ```

  ```json 500 theme={"system"}
  {
    "message": "INTERNAL_SERVER_ERROR",
    "requestUrl": "/v1/portal-content/{contentId}",
    "body": "Server error."
  }
  ```
</ResponseExample>


## OpenAPI

````yaml openapi-portal-content.json PUT /v1/portal-content/{contentId}
openapi: 3.0.0
info:
  title: Portal Content API
  description: API for managing Game Portal content items.
  version: '1.0'
  contact: {}
servers:
  - url: https://api.appcharge.com
security: []
tags: []
paths:
  /v1/portal-content/{contentId}:
    put:
      tags:
        - Portal Content
      summary: Update Content
      description: Updates a content item.
      operationId: update-content
      parameters:
        - name: contentId
          in: path
          required: true
          description: Content ID.
          schema:
            type: string
            example: 507f1f77bcf86cd799439011
        - name: x-publisher-token
          required: true
          in: header
          description: Publisher token.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateContentRequest'
      responses:
        '200':
          description: Content updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentItem'
        '400':
          description: Invalid request body or validation error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                message: BAD_REQUEST
                requestUrl: /v1/portal-content/{contentId}
                body: Invalid request body or validation error.
        '401':
          description: Invalid or missing publisher token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                message: UNAUTHORIZED
                requestUrl: /v1/portal-content/{contentId}
                body: Invalid or missing publisher token.
        '404':
          description: Content not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                message: NOT_FOUND
                requestUrl: /v1/portal-content/{contentId}
                body: Content not found.
        '409':
          description: Slug already exists.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                message: CONFLICT
                requestUrl: /v1/portal-content/{contentId}
                body: Slug already exists.
        '500':
          description: Server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                message: INTERNAL_SERVER_ERROR
                requestUrl: /v1/portal-content/{contentId}
                body: Server error.
components:
  schemas:
    UpdateContentRequest:
      type: object
      properties:
        title:
          type: string
          description: Content title.
          example: Welcome to Our Game - Updated
        subTitle:
          type: string
          description: 'Content description. '
        bodyText:
          type: string
          description: Content body text.
        headerImage:
          type: string
          description: 'Content header image URL. '
        thumbnailImage:
          type: string
          description: 'Content thumbnail image URL. '
        labels:
          type: array
          items:
            type: string
          description: List of labels associated with the content.
          example:
            - tutorial
            - beginner
            - featured
        state:
          type: string
          description: Current state of the content.
          default: visible
          enum:
            - visible
            - hidden
            - scheduled
          example: visible
        contentType:
          type: string
          enum:
            - article
            - news
          description: 'Type: article or news.'
        publishDate:
          type: string
          format: date-time
          description: Content publish date. Use for scheduling content.
        pages:
          type: array
          items:
            type: string
          description: List of pages where this content appears.
        slug:
          type: string
          description: Content slug. If not provided, this value is auto-generated.
        visibility:
          type: string
          enum:
            - public
            - private
          description: Content visibility level.
          default: public
          example: public
        tag:
          type: string
          description: Internal tag for organizing your content. Not visible to players.
          example: spring2025
        translations:
          type: array
          items:
            $ref: '#/components/schemas/TranslationRequest'
          description: >-
            List of translations for the content item. Each object represents a
            locale and its translations. 

             **Note:** You must first [add the locale in the Publisher Dashboard](/../../guides/translations/add-and-manage-languages) before adding its translations.
    ContentItem:
      type: object
      properties:
        id:
          type: string
          description: Content ID.
          example: 507f1f77bcf86cd799439011
        title:
          type: string
          description: Content title.
          example: Welcome to Our Game
        subTitle:
          type: string
          description: Content description.
          example: Everything you need to know
        bodyText:
          type: string
          description: Content body text.
          example: This is the main content body with detailed information...
        headerImage:
          type: string
          description: Content header image URL.
          example: https://cdn.example.com/images/header.jpg
        thumbnailImage:
          type: string
          description: Content thumbnail image URL.
          example: >-
            https://media.appcharge.com/media/25cb4861ec8924a6b69a0f59/book-shelf1920.jpg
        labels:
          type: array
          items:
            type: string
          description: List of labels associated with the content.
          example:
            - tutorial
            - beginner
        state:
          type: string
          description: Current state of the content.
          default: hidden
          enum:
            - visible
            - hidden
            - scheduled
          example: hidden
        contentType:
          type: string
          enum:
            - article
            - news
          description: Content type.
          example: article
        publishDate:
          type: string
          format: date-time
          description: Content publish date. Use for scheduling content.
          example: '2025-10-20T00:00:00.000Z'
        slug:
          type: string
          description: Content slug. If not provided, this value is auto-generated.
          example: welcome-to-our-game
        visibility:
          type: string
          enum:
            - public
            - private
          description: Content visibility level.
          default: public
          example: public
        tag:
          type: string
          description: Internal tag for organizing your content. Not visible to players.
          example: spring2025
        createdAt:
          type: string
          format: date-time
          description: Created date.
          example: '2025-10-15T10:30:00.000Z'
        updatedAt:
          type: string
          format: date-time
          description: Updated date.
          example: '2025-10-19T14:20:00.000Z'
        translations:
          type: array
          items:
            $ref: '#/components/schemas/TranslationResponse'
          description: >-
            List of translations for the content item. Each object represents a
            locale and its translations.
        pages:
          type: array
          items:
            $ref: '#/components/schemas/Page'
          description: List of pages where this content appears.
          example:
            - id: 68b0249eb5bd5c59b9bab7e2
              pageName: FAQs
            - id: 692eb70d0293e07ab4895518
              pageName: Events
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: Error message.
        requestUrl:
          type: string
          description: URL of the request that caused the error.
        body:
          type: string
          description: Error description.
    TranslationRequest:
      type: object
      required:
        - isoCode
        - title
        - subTitle
        - bodyText
        - headerImage
        - thumbnailImage
        - labels
      properties:
        isoCode:
          type: string
          description: >-
            The locale code. Both
            [ISO-639-1](https://en.wikipedia.org/wiki/ISO_639-1) language code
            and [ISO-3166-1
            alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country
            code formats are supported.
          example: fr-FR
        title:
          type: string
          description: Translated title.
          example: Bienvenue dans notre jeu
        subTitle:
          type: string
          description: Translated subtitle.
          example: Tout ce que vous devez savoir
        bodyText:
          type: string
          description: Translated body text.
          example: Ceci est le contenu principal de l'article en français...
        headerImage:
          type: string
          description: >-
            Translated header image URL. Can be an external link or the URL of
            an image from the Assets Library.
          example: https://cdn.example.com/images/header-fr.jpg
        thumbnailImage:
          type: string
          description: >-
            Translated thumbnail image URL. Can be an external link or the URL
            of an image from the Assets Library.
          example: >-
            https://media.appcharge.com/media/25cb4861ec8924a6b69a0f59/book-shelf1920.jpg
        labels:
          type: array
          items:
            type: string
          description: Translated labels.
          example:
            - tutoriel
            - débutant
    TranslationResponse:
      type: object
      properties:
        isoCode:
          type: string
          description: >-
            The locale code. Both
            [ISO-639-1](https://en.wikipedia.org/wiki/ISO_639-1) language code
            and [ISO-3166-1
            alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country
            code formats are supported.
          example: fr-FR
        title:
          type: string
          description: Translated title.
          example: Bienvenue dans notre jeu
        subTitle:
          type: string
          description: Translated description.
          example: Tout ce que vous devez savoir
        bodyText:
          type: string
          description: Translated body text.
          example: Ceci est le contenu principal de l'article en français...
        headerImage:
          type: string
          description: Translated header image URL.
          example: https://cdn.example.com/images/header-fr.jpg
        thumbnailImage:
          type: string
          description: Translated thumbnail image URL.
          example: >-
            https://media.appcharge.com/media/25cb4861ec8924a6b69a0f59/book-shelf1920.jpg
        labels:
          type: array
          items:
            type: string
          description: Translated labels.
          example:
            - tutoriel
            - débutant
    Page:
      type: object
      properties:
        id:
          type: string
          description: Page ID.
          example: 6850249eb5bd5c59b9bab7e2
        pageName:
          type: string
          description: Page name.
          example: faq

````