---
updatedAt: 2026-05-20T09:44:11.000Z
agentTools:
  projectIndex: https://developer.bitlabs.ai/llms.txt
---

# Import Users

Bulk imports given user accounts. This feature must be enabled by your account manager!
If more than one user is sent in a request, that request is treated as a bulk import. Only
one bulk import can be issued at a time. If only one user is set, you can call the endpoint in
parallel.


# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "version": "2.0.160",
    "title": "BitLabs Client API",
    "description": "BitLabs' public API to be integrated by our own products as well as publishers who desire maximum customization.\n",
    "contact": {
      "name": "BitLabs",
      "email": "contact@bitlabs.ai",
      "url": "https://bitlabs.ai"
    }
  },
  "servers": [
    {
      "url": "https://api.bitlabs.ai"
    }
  ],
  "security": [
    {
      "HeaderApiToken": [],
      "HeaderUserId": []
    },
    {
      "QueryApiToken": [],
      "QueryUserId": []
    },
    {
      "HeaderBearerToken": []
    }
  ],
  "tags": [
    {
      "name": "Server-Side",
      "description": "Different endpoints to be used via a Server-to-Server integration. They require a different authentication\nmechanism and offer administrative functionality.\n"
    }
  ],
  "paths": {
    "/v1/publishers/users": {
      "post": {
        "summary": "Import Users",
        "description": "Bulk imports given user accounts. This feature must be enabled by your account manager!\nIf more than one user is sent in a request, that request is treated as a bulk import. Only\none bulk import can be issued at a time. If only one user is set, you can call the endpoint in\nparallel.\n",
        "operationId": "importUsers",
        "tags": [
          "Server-Side"
        ],
        "security": [
          {
            "HeaderS2sToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportUsersBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ImportUsersResponse"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "HeaderApiToken": {
        "type": "apiKey",
        "name": "X-Api-Token",
        "in": "header",
        "description": "ApiToken of your BitLabs app."
      },
      "HeaderUserId": {
        "type": "apiKey",
        "name": "X-User-Id",
        "in": "header",
        "description": "Unique identifier of the user you are sending to BitLabs. These are passed back to you in callbacks to allow\nyou to identify your users. If possible, use UUIDs, numerical IDs or ASCII strings to avoid formatting issues.\nDo NOT use JWT or other sensitive tokens to identify your users. We only support up to 65 character long ids.\n"
      },
      "QueryApiToken": {
        "type": "apiKey",
        "name": "token",
        "in": "query",
        "description": "ApiToken of your BitLabs app."
      },
      "QueryUserId": {
        "type": "apiKey",
        "name": "uid",
        "in": "query",
        "description": "Unique identifier of the user you are sending to BitLabs. These are passed back to you in callbacks to allow\nyou to identify your users. If possible, use UUIDs, numerical IDs or ASCII strings to avoid formatting issues.\nDo NOT use JWT or other sensitive tokens to identify your users. We only support up to 65 character long ids.\n"
      },
      "HeaderS2sToken": {
        "type": "apiKey",
        "name": "X-S2S-Token",
        "in": "header",
        "description": "S2S (server to server) token of your BitLabs app."
      },
      "HeaderBearerToken": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Enter the token with the `Bearer ` prefix, e.g. \"Bearer abcde12345\".\n"
      }
    },
    "schemas": {
      "ImportUsersBody": {
        "type": "object",
        "required": [
          "users"
        ],
        "properties": {
          "users": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImportUser"
            }
          }
        }
      },
      "ImportUser": {
        "type": "object",
        "required": [
          "uid",
          "birthdate",
          "gender",
          "questions"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "example": "your_unique_id"
          },
          "zipcode": {
            "type": "string",
            "example": "00000"
          },
          "birthdate": {
            "type": "string",
            "example": "1999-01-01"
          },
          "gender": {
            "type": "string",
            "enum": [
              "MALE",
              "FEMALE",
              "OTHER"
            ]
          },
          "questions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImportUserQuestion"
            }
          },
          "username": {
            "type": "string",
            "description": "Allows specifying a display name for the requesting user which is used for features such as the leaderboard. Only alpha-numeric characters are allowed."
          }
        }
      },
      "ImportUserQuestion": {
        "type": "object",
        "required": [
          "id",
          "direct_values"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "network_id": {
            "type": "integer",
            "description": "Should be left empty/null."
          },
          "direct_values": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ImportUsersResponse": {
        "type": "object",
        "required": [
          "success_count",
          "errors"
        ],
        "properties": {
          "success_count": {
            "type": "integer",
            "description": "Number of successfully imported users from the request"
          },
          "errors": {
            "type": "array",
            "description": "Contains all users that could not be imported due to an error",
            "items": {
              "$ref": "#/components/schemas/ImportUsersResponseError"
            }
          }
        }
      },
      "ImportUsersResponseError": {
        "type": "object",
        "required": [
          "uid"
        ],
        "properties": {
          "uid": {
            "type": "string"
          },
          "invalid_birthdate": {
            "type": "string",
            "description": "If this field is not null, the birthdate cannot be validated"
          },
          "invalid_gender": {
            "type": "string",
            "description": "If this field is not null, the gender cannot be validated"
          },
          "invalid_zipcode": {
            "type": "string",
            "description": "If this field is not null, the zipcode cannot be validated"
          },
          "invalid_question": {
            "type": "string",
            "description": "If this field is not null, the question was not found or there is no mapping for the given answer values"
          },
          "unsupported_languages": {
            "type": "boolean",
            "description": "If this field is true, the user was ignored because it did not have any supported languages."
          },
          "invalid_answer_format": {
            "$ref": "#/components/schemas/ImportUsersResponseErrorAnswerFormat"
          }
        }
      },
      "ImportUsersResponseErrorAnswerFormat": {
        "description": "If this field is not null, the supplied answer for the given question is invalid.",
        "type": "object",
        "required": [
          "question",
          "reason"
        ],
        "properties": {
          "question": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        }
      }
    }
  }
}
```