---
updatedAt: 2026-07-07T07:30:13.000Z
agentTools:
  projectIndex: https://docs.getembed.ai/llms.txt
---

# Ingest user data

Ingest user profile data from various protocols

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Datasources",
    "description": "APIs for managing datasources and ingesting structured data from web3 and social media protocols and apps",
    "version": "3.0.0",
    "contact": {
      "name": "embed Support",
      "email": "support@mbd.xyz"
    },
    "license": {
      "name": "Proprietary",
      "url": "https://mbd.xyz/terms"
    },
    "termsOfService": "https://mbd.xyz/terms"
  },
  "servers": [
    {
      "url": "https://api.mbd.xyz/v3",
      "description": "Production API"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/datasources/{datasource_id}/users": {
      "post": {
        "summary": "Ingest user data",
        "description": "Ingest user profile data from various protocols",
        "operationId": "ingestUsers",
        "tags": [
          "Data Ingestion"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/DatasourceId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/User"
                },
                "description": "Array of users to ingest. A single user object is also accepted."
              },
              "examples": {
                "single_user": {
                  "summary": "Single user",
                  "value": [
                    {
                      "user_id": "farcaster.alice123",
                      "protocol": "farcaster",
                      "created_at": "2024-01-15T10:30:00Z",
                      "updated_at": "2024-01-15T10:30:00Z",
                      "username": "alice",
                      "display_name": "Alice Cooper",
                      "bio": "Web3 developer and content creator"
                    }
                  ]
                },
                "bulk_users": {
                  "summary": "Multiple users",
                  "value": [
                    {
                      "user_id": "lens.creator456",
                      "protocol": "lens",
                      "created_at": "2024-01-15T10:30:00Z",
                      "updated_at": "2024-01-15T10:30:00Z",
                      "username": "creator456",
                      "display_name": "Content Creator"
                    },
                    {
                      "user_id": "mirror.writer321",
                      "protocol": "mirror",
                      "created_at": "2024-01-15T11:00:00Z",
                      "updated_at": "2024-01-15T11:00:00Z",
                      "username": "writer321",
                      "display_name": "Technical Writer"
                    }
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Users ingested successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IngestionResponse"
                },
                "example": {
                  "message": "Data ingested successfully",
                  "stream_name": "datasource-example.items"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "The number of allowed requests in the current period",
                "schema": {
                  "type": "integer",
                  "example": 1000
                }
              },
              "X-RateLimit-Remaining": {
                "description": "The number of remaining requests in the current period",
                "schema": {
                  "type": "integer",
                  "example": 999
                }
              },
              "X-RateLimit-Reset": {
                "description": "The time at which the current rate limit window resets (Unix timestamp)",
                "schema": {
                  "type": "integer",
                  "example": 1609459200
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationError"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "Console API key. Use `Bearer mbd-{your-api-key}`."
      }
    },
    "parameters": {
      "DatasourceId": {
        "name": "datasource_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^datasource-[a-zA-Z0-9]+-[a-zA-Z0-9]+$",
          "example": "datasource-e07d2ec0-643a"
        },
        "description": "Unique datasource identifier"
      }
    },
    "schemas": {
      "User": {
        "type": "object",
        "required": [
          "user_id",
          "protocol",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "user_id": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$",
            "example": "farcaster.alice123",
            "description": "Format: protocol.protocol_user_id"
          },
          "protocol": {
            "type": "string",
            "enum": [
              "farcaster",
              "mirror",
              "lens",
              "twitter",
              "instagram"
            ],
            "example": "farcaster",
            "description": "Source protocol"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
            "example": "2024-01-15T10:30:00Z",
            "description": "ISO 8601 UTC timestamp"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
            "example": "2024-01-15T10:30:00Z",
            "description": "ISO 8601 UTC timestamp"
          },
          "username": {
            "type": "string",
            "example": "alice",
            "description": "Username/handle"
          },
          "display_name": {
            "type": "string",
            "example": "Alice Cooper",
            "description": "Display name"
          },
          "bio": {
            "type": "string",
            "example": "Web3 developer and content creator",
            "description": "User biography"
          },
          "email": {
            "type": "string",
            "format": "email",
            "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$",
            "description": "Email address"
          },
          "avatar_url": {
            "type": "string",
            "format": "uri",
            "pattern": "^https?://.*$",
            "description": "Avatar image URL"
          },
          "banner_url": {
            "type": "string",
            "format": "uri",
            "pattern": "^https?://.*$",
            "description": "Banner image URL"
          },
          "website": {
            "type": "string",
            "format": "uri",
            "pattern": "^https?://.*$",
            "description": "Website URL"
          },
          "location": {
            "type": "string",
            "description": "Geographic location"
          },
          "follower_count": {
            "type": "integer",
            "minimum": 0,
            "example": 1250,
            "description": "Follower count"
          },
          "following_count": {
            "type": "integer",
            "minimum": 0,
            "example": 890,
            "description": "Following count"
          },
          "post_count": {
            "type": "integer",
            "minimum": 0,
            "description": "Post count"
          },
          "verified": {
            "type": "boolean",
            "example": true,
            "description": "Verification status"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "developer",
              "web3"
            ],
            "description": "Array of tag strings",
            "maxItems": 50
          },
          "preferences": {
            "type": "object",
            "description": "User preferences"
          },
          "metadata": {
            "type": "object",
            "description": "Protocol-specific metadata"
          }
        }
      },
      "IngestionResponse": {
        "type": "object",
        "required": [
          "message",
          "stream_name"
        ],
        "properties": {
          "message": {
            "type": "string",
            "example": "Data ingested successfully",
            "description": "Success message"
          },
          "stream_name": {
            "type": "string",
            "example": "datasource-e07d2ec0-643a.items",
            "description": "Target Kinesis stream name"
          },
          "sequence_number": {
            "type": "string",
            "example": "49610918017569739920569266808940816015796745953697128450",
            "description": "Kinesis sequence number (for single records)"
          },
          "total_records": {
            "type": "integer",
            "example": 3,
            "description": "Total number of records (for bulk operations)"
          },
          "successful_records": {
            "type": "integer",
            "example": 3,
            "description": "Number of successfully processed records (for bulk operations)"
          },
          "failed_records": {
            "type": "integer",
            "example": 0,
            "description": "Number of failed records (for bulk operations)"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "Error message"
          },
          "details": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Detailed error information (for validation errors)"
          },
          "debug_info": {
            "type": "object",
            "description": "Debug information (for development)"
          }
        }
      },
      "ValidationErrorResponse": {
        "type": "object",
        "required": [
          "error",
          "details"
        ],
        "properties": {
          "error": {
            "type": "string",
            "example": "Validation failed",
            "description": "Error type"
          },
          "details": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "Missing required field: item_id",
              "Field timestamp should be int, got str"
            ],
            "description": "List of validation errors"
          }
        }
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Unauthorized - invalid or missing API key",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "missing_auth": {
                "summary": "Missing Authorization header",
                "value": {
                  "error": "Authorization header required"
                }
              },
              "invalid_key": {
                "summary": "Invalid API key",
                "value": {
                  "error": "Invalid API key"
                }
              }
            }
          }
        }
      },
      "ValidationError": {
        "description": "Validation failed",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ValidationErrorResponse"
            },
            "example": {
              "error": "Validation failed",
              "details": [
                "Missing required field: item_id",
                "Field timestamp should be int, got str",
                "Field item_id has invalid format. Expected format: ^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"
              ]
            }
          }
        }
      },
      "InternalServerError": {
        "description": "Internal server error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "error": "Internal server error"
            }
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Data Ingestion",
      "description": "Data ingestion operations for items, users, and interactions"
    }
  ],
  "externalDocs": {
    "description": "Complete API Documentation",
    "url": "https://github.com/mbdxyz/data-ingestion-api/blob/main/README.md"
  }
}
```