---
updatedAt: 2026-05-20T09:37:17.000Z
agentTools:
  projectIndex: https://dev.gotom.io/llms.txt
---

# Get a list of goTom primary keys with names

Get a list of goTom primary keys with associated names to the provided entity. The primary keys provided here are needed in other calls like to create CampaignFlight. It contains pagination after a 1000 max result limit. E-mail field is displayed only if user entity is requested.


# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "version": "4.4.12",
    "title": "Campaign API"
  },
  "x-explorer-enabled": false,
  "paths": {
    "/app-api/primary-keys/{entity}": {
      "get": {
        "tags": [
          "Primary-Keys"
        ],
        "summary": "Get a list of goTom primary keys with names",
        "description": "Get a list of goTom primary keys with associated names to the provided entity. The primary keys provided here are needed in other calls like to create CampaignFlight. It contains pagination after a 1000 max result limit. E-mail field is displayed only if user entity is requested.\n",
        "parameters": [
          {
            "in": "path",
            "name": "entity",
            "description": "This is the entity name. Typically if looking for say, 'tarifId', the entity is called 'tarif'. And the `id` value returned is what one would enter as `tarifId`.",
            "schema": {
              "type": "string",
              "enum": [
                "user",
                "tarif",
                "priceType",
                "adServer",
                "campaignType",
                "extraPriceLevel",
                "platform",
                "channel",
                "media",
                "advertising",
                "flightPositionType",
                "flightTags"
              ]
            },
            "required": true
          },
          {
            "in": "query",
            "name": "page",
            "description": "From 1 to the last page number found in the pagination part of the response.",
            "schema": {
              "type": "integer",
              "default": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns pagination, items",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrimaryKeysRead"
                }
              }
            }
          },
          "422": {
            "description": "Invalid entity provided.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "msg": {
                          "type": "string",
                          "example": "'tarifffff' is not a valid entity. Valid entities are: 'user','adServer','tarif','priceType','campaignType','extraPriceLevel','platform','channel','media','advertising'"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Pagination": {
        "type": "object",
        "required": [
          "totalItems",
          "perPage",
          "currentPage",
          "lastPage",
          "nextPageUrl"
        ],
        "properties": {
          "totalItems": {
            "type": "integer",
            "example": 300
          },
          "perPage": {
            "type": "integer",
            "example": 100
          },
          "currentPage": {
            "type": "integer",
            "example": 1
          },
          "lastPage": {
            "type": "integer",
            "example": 3
          },
          "nextPageUrl": {
            "type": "string",
            "nullable": true,
            "example": "https://yourinstance.gotom.io/app-api/example/1?page=2"
          }
        }
      },
      "PrimaryKeysRead": {
        "description": "A primary key, item name list",
        "type": "object",
        "properties": {
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "name"
              ],
              "properties": {
                "id": {
                  "description": "The primary key of the item. This is always an integer except for entity `adServer`, where it is a string",
                  "oneOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "string"
                    }
                  ]
                },
                "name": {
                  "description": "The associated name of the primary key. For example, the name of the channel.",
                  "type": "string",
                  "example": "Desktop"
                },
                "email": {
                  "description": "The associated email of the primary key or User, this field is shown only if primary key for user entity is requested.",
                  "type": "string",
                  "example": "if_user_entity_given@gotom.io"
                },
                "isDefault": {
                  "description": "Whether the flightPositionType is the default value or not, only for flightPositionType",
                  "type": "boolean",
                  "example": true
                }
              }
            }
          }
        }
      }
    }
  }
}
```