@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Ingestion API
@base https://api.mixpanel.com
@version 1.0.0
@endpoints 20
@toc import(1), track(1), engage#profile-set(1), engage#profile-set-once(1), engage#profile-numerical-add(1), engage#profile-union(1), engage#profile-list-append(1), engage#profile-list-remove(1), engage#profile-unset(1), engage#profile-batch-update(1), engage#profile-delete(1), groups#group-set(1), groups#group-set-once(1), groups#group-unset(1), groups#group-remove-from-list(1), groups#group-union(1), groups#group-batch-update(1), groups#group-delete(1), lookup-tables(2)

@group import
@endpoint POST /import
@desc Import Events
@required {strict: str(0/1)=1 # When set to 1 (recommended), Mixpanel will validate the batch and return errors per event that failed., project_id: str=<YOUR_PROJECT_ID> # The Mixpanel project_id, used to authenticate service account credentials.}
@optional {Content-Type: str(application/json/application/x-ndjson)=application/json, Content-Encoding: str}
@returns(200) {code: int, num_records_imported: int, status: str} # A 200 response indicates all records were successfully ingested.
@errors {400: A 400 response indicates that some records failed validation., 401: A 401 response indicates invalid credentials., 413: A 413 response indicates that the payload is too large., 429: A 429 response indicates rate limits have been exceeded.}

@endgroup

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

@endgroup

@group engage#profile-set
@endpoint POST /engage#profile-set
@desc Set Property
@returns(200) * `1` - One or more objects provided are valid. This does not signify a valid project token or secret. * `0` - No data objects in the body are valid.
@errors {401: Unauthorized, 403: Forbidden}

@endgroup

@group engage#profile-set-once
@endpoint POST /engage#profile-set-once
@desc Set Property Once
@returns(200) * `1` - One or more objects provided are valid. This does not signify a valid project token or secret. * `0` - No data objects in the body are valid.
@errors {401: Unauthorized, 403: Forbidden}

@endgroup

@group engage#profile-numerical-add
@endpoint POST /engage#profile-numerical-add
@desc Increment Numerical Property
@returns(200) * `1` - One or more objects provided are valid. This does not signify a valid project token or secret. * `0` - No data objects in the body are valid.
@errors {401: Unauthorized, 403: Forbidden}

@endgroup

@group engage#profile-union
@endpoint POST /engage#profile-union
@desc Union To List Property
@returns(200) * `1` - One or more objects provided are valid. This does not signify a valid project token or secret. * `0` - No data objects in the body are valid.
@errors {401: Unauthorized, 403: Forbidden}

@endgroup

@group engage#profile-list-append
@endpoint POST /engage#profile-list-append
@desc Append to List Property
@returns(200) * `1` - One or more objects provided are valid. This does not signify a valid project token or secret. * `0` - No data objects in the body are valid.
@errors {401: Unauthorized, 403: Forbidden}

@endgroup

@group engage#profile-list-remove
@endpoint POST /engage#profile-list-remove
@desc Remove from List Property
@returns(200) * `1` - One or more objects provided are valid. This does not signify a valid project token or secret. * `0` - No data objects in the body are valid.
@errors {401: Unauthorized, 403: Forbidden}

@endgroup

@group engage#profile-unset
@endpoint POST /engage#profile-unset
@desc Delete Property
@returns(200) * `1` - One or more objects provided are valid. This does not signify a valid project token or secret. * `0` - No data objects in the body are valid.
@errors {401: Unauthorized, 403: Forbidden}

@endgroup

@group engage#profile-batch-update
@endpoint POST /engage#profile-batch-update
@desc Update Multiple Profiles
@returns(200) * `1` - One or more objects provided are valid. This does not signify a valid project token or secret. * `0` - No data objects in the body are valid.
@errors {401: Unauthorized, 403: Forbidden}

@endgroup

@group engage#profile-delete
@endpoint POST /engage#profile-delete
@desc Delete Profile
@returns(200) * `1` - One or more objects provided are valid. This does not signify a valid project token or secret. * `0` - No data objects in the body are valid.
@errors {401: Unauthorized, 403: Forbidden}

@endgroup

@group groups#group-set
@endpoint POST /groups#group-set
@desc Update Property
@returns(200) * `1` - One or more objects provided are valid. This does not signify a valid project token or secret. * `0` - No data objects in the body are valid.
@errors {401: Unauthorized, 403: Forbidden}

@endgroup

@group groups#group-set-once
@endpoint POST /groups#group-set-once
@desc Set Property Once
@returns(200) * `1` - One or more objects provided are valid. This does not signify a valid project token or secret. * `0` - No data objects in the body are valid.
@errors {401: Unauthorized, 403: Forbidden}

@endgroup

@group groups#group-unset
@endpoint POST /groups#group-unset
@desc Delete Property
@returns(200) * `1` - One or more objects provided are valid. This does not signify a valid project token or secret. * `0` - No data objects in the body are valid.
@errors {401: Unauthorized, 403: Forbidden}

@endgroup

@group groups#group-remove-from-list
@endpoint POST /groups#group-remove-from-list
@desc Remove from List Property
@returns(200) * `1` - One or more objects provided are valid. This does not signify a valid project token or secret. * `0` - No data objects in the body are valid.
@errors {401: Unauthorized, 403: Forbidden}

@endgroup

@group groups#group-union
@endpoint POST /groups#group-union
@desc Union To List Property
@returns(200) * `1` - One or more objects provided are valid. This does not signify a valid project token or secret. * `0` - No data objects in the body are valid.
@errors {401: Unauthorized, 403: Forbidden}

@endgroup

@group groups#group-batch-update
@endpoint POST /groups#group-batch-update
@desc Batch Update Group Profiles
@returns(200) * `1` - One or more objects provided are valid. This does not signify a valid project token or secret. * `0` - No data objects in the body are valid.
@errors {401: Unauthorized, 403: Forbidden}

@endgroup

@group groups#group-delete
@endpoint POST /groups#group-delete
@desc Delete Group
@returns(200) * `1` - One or more objects provided are valid. This does not signify a valid project token or secret. * `0` - No data objects in the body are valid.
@errors {401: Unauthorized, 403: Forbidden}

@endgroup

@group lookup-tables
@endpoint GET /lookup-tables
@desc List Lookup Tables
@required {project_id: str=<YOUR_PROJECT_ID> # The Mixpanel project_id, used to authenticate service account credentials.}
@returns(200) {code: num, status: str, results: [map]} # The list of Lookup Tables.
@errors {401: A 401 response indicates invalid credentials.}

@endpoint PUT /lookup-tables/{id}
@desc Replace a Lookup Table
@required {id: str(uuid) # The ID of the lookup table to replace which can be retreived from Lexicon under the lookup table's details, click [here](https://docs.mixpanel.com/docs/data-structure/lookup-tables#where-can-i-find-the-id-of-the-lookup-table-for-apis-path-params) for more info., project_id: str=<YOUR_PROJECT_ID> # The Mixpanel project_id, used to authenticate service account credentials.}
@optional {Content-Type: str=text/csv}
@returns(200) {code: int, status: str} # A 200 response indicates all records were successfully ingested.
@errors {400: A 400 response indicates that some records failed validation., 401: A 401 response indicates invalid credentials., 404: A 404 response indicates that the entity to replace was not found., 413: A 413 response indicates that the payload is too large., 429: A 429 response indicates rate limits have been exceeded.}

@endgroup

@end
