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

# Create a Playlist Entitlement

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Consumers",
    "version": "1.0.0",
    "description": ""
  },
  "servers": [
    {
      "url": "https://api.zype.com/"
    }
  ],
  "security": [
    {
      "api_key": []
    }
  ],
  "components": {
    "securitySchemes": {
      "api_key": {
        "type": "apiKey",
        "name": "api_key",
        "in": "query"
      }
    }
  },
  "paths": {
    "/consumers/{consumer_id}/playlists": {
      "post": {
        "summary": "Create a Playlist Entitlement",
        "description": "",
        "tags": [
          "Playlist Entitlements"
        ],
        "operationId": "createPlaylistEntitlement",
        "parameters": [
          {
            "name": "consumer_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": ""
          }
        ],
        "requestBody": {
          "description": "",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "title": "PlaylistEntitlementRequest",
                "type": "object",
                "properties": {
                  "entitlement": {
                    "required": [
                      "playlist_id"
                    ],
                    "type": "object",
                    "title": "PlaylistEntitlementProperties",
                    "properties": {
                      "playlist_id": {
                        "type": "string",
                        "description": "ID of the playlist you wish the consumer to have access to"
                      },
                      "transaction_id": {
                        "type": "string",
                        "description": "ID of the transaction that happened to allow the consumer to have access to the video"
                      },
                      "transaction_type": {
                        "type": "string",
                        "description": "Type of transaction (Example: purchase)"
                      },
                      "expires_at": {
                        "type": "string",
                        "description": "When the entitlement expires"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "title": "PlaylistEntitlementResponse",
                  "type": "object",
                  "properties": {
                    "response": {
                      "title": "PlaylistEntitlement",
                      "type": "object",
                      "properties": {
                        "_id": {
                          "type": "string"
                        },
                        "consumer_id": {
                          "type": "string"
                        },
                        "created_at": {
                          "type": "string"
                        },
                        "updated_at": {
                          "type": "string"
                        },
                        "expires_at": {
                          "type": "string"
                        },
                        "transaction_id": {
                          "type": "string"
                        },
                        "transaction_type": {
                          "type": "string"
                        },
                        "playlist_title": {
                          "type": "string"
                        },
                        "playlist_id": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Consumer not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/paths/~1pin~1link/put/responses/404/content/application~1json/schema"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/paths/~1consumers/get/responses/422/content/application~1json/schema"
                }
              }
            }
          }
        }
      }
    }
  }
}
```