> For the complete documentation index, see [llms.txt](https://help.mimeeq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.mimeeq.com/api/contacts/create-contact-portal-invitation.md). Agents can also search and read this documentation through its [MCP server](https://help.mimeeq.com/~gitbook/mcp).

# Create Contact Portal Invitation

Give a company contact a login to your customer portal, as a Tier 2 user of their company.

Use this when a contact should be able to sign in to the portal. Take `contactId` from List Contacts. Every successful call sends an email to the contact.

### Behaviour

The email goes to `email`, or to the contact's first email when `email` is omitted; a contact without an email needs one in `email` (`400 wrong_data` otherwise). What happens depends on whether that address already has a Mimeeq login:

| The email                               | Result                                                                                                                             |
| --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| Has no Mimeeq login                     | An invitation is created and sent (`status: INVITED` with its `invitationId`). The contact gets portal access once they accept it. |
| Has a login from another Mimeeq account | Portal access is given at once and the contact is told by email (`status: ASSIGNED`, `invitationId: null`).                        |

`defaultUserLang` sets the portal user's language and must be one of the languages the Mimeeq app offers.

A contact that already has portal access, or an email that already has access, a pending invitation or a Tier 1 login in your account, answers `409 contact_portal_conflict`. A retry after a timeout therefore answers 409 instead of sending a second invitation; read Get Contact to see the result.

`422 contact_cannot_be_invited` means the invitation was refused; `details.reason` says which check failed:

| `details.reason`            | Meaning                                             |
| --------------------------- | --------------------------------------------------- |
| `contact_inactive`          | The contact is inactive.                            |
| `company_inactive`          | The contact's company is inactive.                  |
| `account_inactive`          | Your Mimeeq account is not active.                  |
| `invitations_disabled`      | Portal invitations are turned off for your account. |
| `portal_user_limit_reached` | The account has reached its portal user limit.      |
| `email_is_mimeeq_admin`     | The email belongs to a Mimeeq administrator.        |

A refusal the backend does not tell apart answers without `details`.

Requires the `contacts:write` scope.

```json
{"openapi":"3.1.0","info":{"title":"Mimeeq External API","version":"1.3.0"},"tags":[{"name":"Contacts","description":"Manage people associated with companies in your Mimeeq account. A contact is a business record; creating one does not create a Tier 1 account user or send an invitation.\n\nUse this section to synchronize names, email addresses, contact details and reporting relationships from a CRM, and to give contacts access to your customer portal. Contact detail also exposes invitation and portal-user assignment state where available.\n\n## What you can do\n\n| Task | Reference |\n| --- | --- |\n| Find available contacts | [List Contacts](https://help.mimeeq.com/api/contacts/list-contacts) |\n| Add a new contact | [Create Contact](https://help.mimeeq.com/api/contacts/create-contact) |\n| Read one contact | [Get Contact](https://help.mimeeq.com/api/contacts/get-contact) |\n| Change contact | [Update Contact](https://help.mimeeq.com/api/contacts/update-contact) |\n| Remove a contact | [Delete Contact](https://help.mimeeq.com/api/contacts/delete-contact) |\n| Give a contact portal access | [Create Contact Portal Invitation](https://help.mimeeq.com/api/contacts/create-contact-portal-invitation) |\n| Revoke a contact's portal access | [Delete Contact Portal Access](https://help.mimeeq.com/api/contacts/delete-contact-portal-access) |\n\n## Before you start\n\nYour API key needs `contacts:read` to read these resources. Use `contacts:write` for write operations, including portal invitations. Deleting a contact or revoking its portal access needs `contacts:delete`.\n\n## Important behaviour\n\nCreate the company first and use its `companyId`. A reporting manager must be another contact in the same company. Updates replace submitted fields and arrays; changing a contact’s company can be rejected when it has quotations, an invitation or a portal user. Use Users, Invitations and Roles for Tier 1 account access. A contact with quotations cannot be deleted (`409 contact_in_use`).\n\n## Portal access\n\nA contact can be given a login to your customer portal, as a Tier 2 user of their company, with Create Contact Portal Invitation; Delete Contact Portal Access takes it away again and keeps the contact. Get Contact shows the state in `isInvited` and `isUserAssigned`. Every successful invitation sends an email, and an address can hold only one invitation or login in your account at a time. Deleting a contact also deletes its portal login when that login belongs to no other Mimeeq account."}],"servers":[{"url":"https://admin.mimeeqapi.com","description":"Production API"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"API key sent as a bearer token (mk_live_… / mk_test_…)."}},"schemas":{"ContactsMutation2":{"type":"object","properties":{"data":{"type":"object","properties":{"invitationId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Null when an existing Mimeeq user was given access directly."},"status":{"type":"string","enum":["INVITED","ASSIGNED"]}},"required":["invitationId","status"],"additionalProperties":false}},"required":["data"],"additionalProperties":false,"description":"Data schema used by Create Contact Portal Invitation (POST /v1/contacts/{contactId}/portal-invitation). Read that operation for usage, permissions and update rules. Required fields and allowed values are defined below; request and response shapes can differ."},"PublicError":{"description":"An API error response. Use code and the HTTP status to classify the failure, message and optional details for context, and requestId when reporting it. Edge firewall responses may omit requestId.","type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string","description":"Present on every error the API itself returns; absent when the edge firewall rejected the request."},"details":{"description":"Optional error-specific details (e.g. per-field validation reasons)."}}},"ContactsPortalInvitationRequest":{"type":"object","properties":{"email":{"description":"Portal login. Defaults to the contact's first email.","type":"string"},"defaultUserLang":{"description":"Language code for the contact's portal user, one of the languages the Mimeeq app offers.","enum":["en","ar","af","am","ar-ae","ar-bh","ar-dz","ar-eg","ar-iq","ar-jo","ar-kw","ar-lb","ar-ly","ar-ma","arn","ar-om","ar-qa","ar-sa","ar-sy","ar-tn","ar-ye","as","az-az-cyrl","az-az-latn","ba","be","bg","bn-bd","bn-in","bo","br","bs-ba-cyrl","bs-ba-latn","ca","co","cs","cy","da","de-at","de-ch","de","de-li","de-lu","dsb","dv","el","en-029","en-au","en-bz","en-ca","en-gb","en-ie","en-in","en-jm","en-my","en-nz","en-ph","en-sg","en-tt","en-us","en-za","en-zw","es-ar","es-bo","es-cl","es-co","es-cr","es-do","es-ec","es","es-gt","es-hn","es-mx","es-ni","es-pa","es-pe","es-pr","es-py","es-sv","es-us","es-uy","es-ve","et","eu","fa","fi","fil","fo","fr-be","fr-ca","fr-ch","fr","fr-lu","fr-mc","fy","ga","gd","gl","gsw","gu","ha-ng-latn","he","hi","hr-ba","hr","hsb","hu","hy","id","ig","ii","is","it-ch","it","iu-ca-cans","iu-ca-latn","ja","ka","kk","kl","km","kn","kok","ko","ky","lb","lo","lt","lv","mi","mk","ml","mn","mn-cn-mong","moh","mr","ms-bn","ms","mt","nb","ne","nl-be","nl","nn","nso","oc","or","pa","pl","prs","ps","pt-br","pt","rm","ro","ru","rw","sah","sa","se-fi","se-no","se","si","sk","sl","sma-no","sma-se","smj-no","smj-se","smn","sms","sq","sr-ba-cyrl","sr-cs-cyrl","sr-me-cyrl","sr-rs-cyrl","sr-ba-latn","sr-cs-latn","sr-me-latn","sr-rs-latn","sv-fi","sv-se","sw","syr","ta","te","tg-tj-cyrl","th","tk","tn","tr","tt","ug","uk","ur","uz-uz-cyrl","uz-uz-latn","vi","wo","xh","yo","zh","zh-hk","zh-mo","zh-sg","zh-tw","zu"],"type":"string"}},"additionalProperties":false,"description":"Data schema used by Create Contact Portal Invitation (POST /v1/contacts/{contactId}/portal-invitation). Read that operation for usage, permissions and update rules. Required fields and allowed values are defined below; request and response shapes can differ."}}},"paths":{"/v1/contacts/{contactId}/portal-invitation":{"post":{"summary":"Create Contact Portal Invitation","tags":["Contacts"],"description":"Give a company contact a login to your customer portal, as a Tier 2 user of their company.\n\nUse this when a contact should be able to sign in to the portal. Take `contactId` from List Contacts. Every successful call sends an email to the contact.\n\n## Behaviour\n\nThe email goes to `email`, or to the contact's first email when `email` is omitted; a contact without an email needs one in `email` (`400 wrong_data` otherwise). What happens depends on whether that address already has a Mimeeq login:\n\n| The email | Result |\n| --- | --- |\n| Has no Mimeeq login | An invitation is created and sent (`status: INVITED` with its `invitationId`). The contact gets portal access once they accept it. |\n| Has a login from another Mimeeq account | Portal access is given at once and the contact is told by email (`status: ASSIGNED`, `invitationId: null`). |\n\n`defaultUserLang` sets the portal user's language and must be one of the languages the Mimeeq app offers.\n\nA contact that already has portal access, or an email that already has access, a pending invitation or a Tier 1 login in your account, answers `409 contact_portal_conflict`. A retry after a timeout therefore answers 409 instead of sending a second invitation; read Get Contact to see the result.\n\n`422 contact_cannot_be_invited` means the invitation was refused; `details.reason` says which check failed:\n\n| `details.reason` | Meaning |\n| --- | --- |\n| `contact_inactive` | The contact is inactive. |\n| `company_inactive` | The contact's company is inactive. |\n| `account_inactive` | Your Mimeeq account is not active. |\n| `invitations_disabled` | Portal invitations are turned off for your account. |\n| `portal_user_limit_reached` | The account has reached its portal user limit. |\n| `email_is_mimeeq_admin` | The email belongs to a Mimeeq administrator. |\n\nA refusal the backend does not tell apart answers without `details`.\n\nRequires the `contacts:write` scope.","responses":{"200":{"description":"Successful response.","headers":{"RateLimit-Limit":{"description":"Requests that can be admitted at once (the tier burst).","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Tokens left after this request.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the bucket is full again.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactsMutation2"}}}},"400":{"description":"Invalid request data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicError"}}},"headers":{"RateLimit-Limit":{"description":"Requests that can be admitted at once (the tier burst).","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Tokens left after this request.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the bucket is full again.","schema":{"type":"integer"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicError"}}}},"403":{"description":"The API key lacks the required scope (`scope_denied`), the operation is not permitted for this account (`operation_not_permitted`), or the account is inactive (`account_inactive`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicError"}}},"headers":{"RateLimit-Limit":{"description":"Requests that can be admitted at once (the tier burst).","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Tokens left after this request.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the bucket is full again.","schema":{"type":"integer"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicError"}}},"headers":{"RateLimit-Limit":{"description":"Requests that can be admitted at once (the tier burst).","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Tokens left after this request.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the bucket is full again.","schema":{"type":"integer"}}}},"409":{"description":"Conflict with the current state (e.g. the resource already exists).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicError"}}},"headers":{"RateLimit-Limit":{"description":"Requests that can be admitted at once (the tier burst).","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Tokens left after this request.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the bucket is full again.","schema":{"type":"integer"}}}},"422":{"description":"Unprocessable entity (e.g. an unconfigured currency or quotation stage).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicError"}}},"headers":{"RateLimit-Limit":{"description":"Requests that can be admitted at once (the tier burst).","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Tokens left after this request.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the bucket is full again.","schema":{"type":"integer"}}}},"429":{"description":"The API key exceeded its request rate (`rate_limit_exceeded`) or its monthly quota (`quota_exceeded`). Both carry `Retry-After`; the `RateLimit-*` headers accompany `rate_limit_exceeded` only, since a spent quota says nothing about the bucket.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicError"}}},"headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}},"RateLimit-Limit":{"description":"Requests that can be admitted at once (the tier burst).","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Tokens left after this request.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the bucket is full again.","schema":{"type":"integer"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicError"}}},"headers":{"RateLimit-Limit":{"description":"Requests that can be admitted at once (the tier burst).","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Tokens left after this request.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the bucket is full again.","schema":{"type":"integer"}}}}},"parameters":[{"name":"contactId","in":"path","required":true,"schema":{"type":"string","pattern":"^CONT-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactsPortalInvitationRequest"}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.mimeeq.com/api/contacts/create-contact-portal-invitation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
