Authentication

Authentication

Learn how to authenticate with the MID API using API keys and manage your credentials securely.

API Key Authentication

The MID API uses API keys to authenticate requests. You can view and manage your API keys in the MID Dashboard.

Your API keys carry many privileges, so be sure to keep them secure. Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, or forums.

Security

Never expose API keys in client-side JavaScript. Always proxy API calls through your server.

Authenticated Request

Server-side request
curl -X GET \
  'https://api.mobid.io/v1/health' \
  -H 'X-Mobid-Key: qk_63ccde4e11274c33b9255224'

Your API Key

A sample test API key is included in all examples. To test with your own account, replace it with your actual API key or sign in.

Errors

MID uses conventional HTTP response codes to indicate the success or failure of an API request. Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error given the information provided. Codes in the 5xx range indicate a server error (these are rare).

Error Attributes

AttributeTypeDescription
codestringShort error code for programmatic handling
messagestringHuman-readable error description
dataobjectAdditional error details (nullable)

HTTP Status Code Summary

CodeMeaning
200OK — Everything worked as expected
400Bad Request — Missing required parameter
401Unauthorized — No valid API key provided
402Request Failed — Valid parameters but request failed
403Forbidden — Insufficient permissions
404Not Found — Resource doesn't exist
409Conflict — Duplicate idempotent key
429Too Many Requests — Rate limit exceeded
5xxServer Error — Something went wrong on MID's end