API Documentation

← Back

countries API

all countries

📚 Submit Data via API

You can submit countries data programmatically using our REST API. Here's everything you need to know to get started.

💡 Quick Start

Download the complete OpenAPI specification:

⬇ Download OpenAPI JSON

Or access it at:

https://your-domain.com/api/v1/types/countries/openapi.json

API Endpoint

POST https://your-domain.com/api/v1/types/countries/data

Authentication

POST requests require Firebase Authentication token in the Authorization header:

Authorization: Bearer YOUR_ACCESS_TOKEN

Request Body (POST)

Submit your data with the following JSON structure:

{
  "name": "Example countries",
  "description": "This is an example countries entry",
  "customData": {
    "emoji": "example value",
    "name": "example value",
    "officialName": "example value",
    "sovereignty": "example value",
    "alpha2": "example value",
    "alpha3": "example value",
    "numeric": "example value"
  },
  "tags": [
    "example",
    "api"
  ]
}

Field Descriptions

  • name - Display name for this entry (required)
  • description - Detailed description of the entry (required)
  • customData - Type-specific data validated against the schema (required)
  • tags - Optional array of tags for categorization

Response

On successful submission, you'll receive the created entry with an auto-generated ID:

{
  "id": "unique-entry-id",
  "typeId": "countries",
  "ownerId": "your-user-id",
  "name": "Example countries",
  "description": "...",
  "customData": { ... },
  "tags": ["example"],
  "dateCreated": 1702467600000,
  "dateModified": 1702467600000
}

Error Handling

  • 400 Bad Request - Missing required fields or invalid data
  • 401 Unauthorized - Missing or invalid authentication token
  • 422 Unprocessable Entity - Data failed validation against schema
  • 500 Server Error - Server processing error