@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Identity API
@base https://api.mixpanel.com
@version 1.0.0
@endpoints 3
@toc track#create-identity(1), track#identity-create-alias(1), import(1)

@group track#create-identity
@endpoint POST /track#create-identity
@desc Create Identity
@returns(200) * `1` - All data objects provided are valid. This does not signify a valid project token or secret. * `0` - One or more data objects in the body are invalid.
@errors {401: Unauthorized, 403: Forbidden}

@endgroup

@group track#identity-create-alias
@endpoint POST /track#identity-create-alias
@desc Create Alias
@returns(200) * `1` - All data objects provided are valid. This does not signify a valid project token or secret. * `0` - One or more data objects in the body are invalid.
@errors {401: Unauthorized, 403: Forbidden}

@endgroup

@group import
@endpoint POST /import
@desc Merge Identities
@required {strict: str(0/1)=1 # When set to 1 (recommended), Mixpanel will validate the batch and return errors per event that failed.}
@optional {project_id: str # The Mixpanel project_id, used to authenticate service account credentials (do not provide if using secret auth).}
@returns(200) {code: int, num_records_imported: int, status: str} # A 200 response indicates all events were successfully ingested.
@errors {400: A 400 response indicates that some events failed validation., 401: A 401 response indicates invalid service account credentials.}

@endgroup

@end
