# Members

## GET /v2.0/admin/members

> Returns all members for a given merchant. Merchant is pulled from the public API key for security reasons.\<br>\<br>\
> &#x20;   Pagination is supported by passing limit and lastCustomerId values as query parameters. You will get a lastCustomerId value in the response of the previous request, which can be used for the next.

```json
{"openapi":"3.0.0","info":{"title":"Inveterate Public API","version":"v2.0"},"paths":{"/v2.0/admin/members":{"get":{"operationId":"MembersController_findAll","summary":"","description":"Returns all members for a given merchant. Merchant is pulled from the public API key for security reasons.<br><br>\n    Pagination is supported by passing limit and lastCustomerId values as query parameters. You will get a lastCustomerId value in the response of the previous request, which can be used for the next.","parameters":[{"name":"X-Inveterate-Api-Key","in":"header","description":"Your private Inveterate API key.","required":true,"schema":{"type":"string"}},{"name":"limit","required":true,"in":"query","schema":{"type":"string"}},{"name":"lastCustomerId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Returned upon successful direct action to our database. Action is immediate.","schema":{"allOf":[{"$ref":"#/components/schemas/ResponseBodyDto"}]},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBodyDto"}}}},"400":{"description":"Returned upon a malformed request. Check your API key, URL parameters, and body parameters when this error is returned. Generally, if you see this error, that also means NO action was taken on our backend.","schema":{"allOf":[{"$ref":"#/components/schemas/ResponseBodyDto"}]},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBodyDto"}}}},"500":{"description":"Returned for all other errors. Generally these come from our backend. Some multipart functions may execute somewhat and then fail, causing some data to be updated.","schema":{"allOf":[{"$ref":"#/components/schemas/ResponseBodyDto"}]},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBodyDto"}}}}},"tags":["Admin - Members"]}}},"components":{"schemas":{"ResponseBodyDto":{"type":"object","properties":{"message":{"type":"string","description":"The message associated with the response. Generally, the message only confirms the requested action. In the case of errors, the message will give insight into the source of the error."},"data":{"type":"object","description":"The data associated with the response. Data is only returned from errors if the error originates from our backend to give further insight into the nature of the error."}},"required":["message","data"]}}}}
```

## POST /v2.0/admin/members

> This endpoint is used to create a free tier member. You can also provide a credit value to add credits to the new members account.\<br>\
> &#x20;   The \`overrideSpendThreshold\` parameter allows you to add customers to a spend based tier, and the \`keepInSpendBasedTier\` parameter\<br>\
> &#x20;   ensures that the member won't be downgraded if they don't hit the spend minimum.\<br>\<br>\
> &#x20;   NOTE: This endpoint will downgrade a customer specified to a lower tier if that is the tier provided to the endpoint!

```json
{"openapi":"3.0.0","info":{"title":"Inveterate Public API","version":"v2.0"},"paths":{"/v2.0/admin/members":{"post":{"operationId":"MembersController_create","summary":"","description":"This endpoint is used to create a free tier member. You can also provide a credit value to add credits to the new members account.<br>\n    The `overrideSpendThreshold` parameter allows you to add customers to a spend based tier, and the `keepInSpendBasedTier` parameter<br>\n    ensures that the member won't be downgraded if they don't hit the spend minimum.<br><br>\n    NOTE: This endpoint will downgrade a customer specified to a lower tier if that is the tier provided to the endpoint!","parameters":[{"name":"X-Inveterate-Api-Key","in":"header","description":"Your private Inveterate API key.","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFreeTierMember"}}}},"responses":{"201":{"description":"Returned upon successful request made to our backend. Requests that return this code may take a small amount of time after successful API return to fully update.","schema":{"allOf":[{"$ref":"#/components/schemas/ResponseBodyDto"}]},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBodyDto"}}}},"400":{"description":"Returned upon a malformed request. Check your API key, URL parameters, and body parameters when this error is returned. Generally, if you see this error, that also means NO action was taken on our backend.","schema":{"allOf":[{"$ref":"#/components/schemas/ResponseBodyDto"}]},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBodyDto"}}}},"500":{"description":"Returned for all other errors. Generally these come from our backend. Some multipart functions may execute somewhat and then fail, causing some data to be updated.","schema":{"allOf":[{"$ref":"#/components/schemas/ResponseBodyDto"}]},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBodyDto"}}}}},"tags":["Admin - Members"]}}},"components":{"schemas":{"CreateFreeTierMember":{"type":"object","properties":{"customerId":{"type":"string","description":"The customerId to add to the specified free tier."},"referrals":{"type":"string","description":"The signify whether or not the customer was referred. NOTE: NOT to be used to indicate the referring customer."},"segmentId":{"type":"string","description":"The segmentId of the tier you want to add this customer to."},"overrideSpendThreshold":{"type":"boolean","description":"Whether or not to override the spend required to add a customer to a spend based tier."},"keepInSpendBasedTier":{"type":"boolean","description":"Whether or not you want to keep this customer in the spend based tier despite not meeting the spend threshold."},"credits":{"type":"number","minimum":1,"description":"Especially for member creation requests, if you would like to add some credits to the specified customer."},"birthday":{"type":"string","description":"The customer's date of birth in YYYY-MM-DD format, e.g \"1988-04-01\""}},"required":["customerId","referrals","segmentId","overrideSpendThreshold","keepInSpendBasedTier","credits","birthday"]},"ResponseBodyDto":{"type":"object","properties":{"message":{"type":"string","description":"The message associated with the response. Generally, the message only confirms the requested action. In the case of errors, the message will give insight into the source of the error."},"data":{"type":"object","description":"The data associated with the response. Data is only returned from errors if the error originates from our backend to give further insight into the nature of the error."}},"required":["message","data"]}}}}
```

{% openapi src="/files/zHjcB1bGhU4GMBZoyzKB" path="/v2.0/admin/members/{id}" method="get" %}
[api v2 docs.json](https://2525587530-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6dZzvfJge656sN0z9p8E%2Fuploads%2F36H8GM7sIeqeWXleiYHk%2Fapi%20v2%20docs.json?alt=media)
{% endopenapi %}

## PATCH /v2.0/admin/members/{id}

> This endpoint is used to update a member. It takes a member ID and uses your public API key to match the customer to your account. As of now, all fields in the update schema are required, so it is not possible to update a single field at a time.

```json
{"openapi":"3.0.0","info":{"title":"Inveterate Public API","version":"v2.0"},"paths":{"/v2.0/admin/members/{id}":{"patch":{"operationId":"MembersController_update","summary":"","description":"This endpoint is used to update a member. It takes a member ID and uses your public API key to match the customer to your account. As of now, all fields in the update schema are required, so it is not possible to update a single field at a time.","parameters":[{"name":"X-Inveterate-Api-Key","in":"header","description":"Your private Inveterate API key.","required":true,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","description":"The customer ID number which you would like to update.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMemberDto"}}}},"responses":{"201":{"description":"Returned upon successful request made to our backend. Requests that return this code may take a small amount of time after successful API return to fully update.","schema":{"allOf":[{"$ref":"#/components/schemas/ResponseBodyDto"}]},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBodyDto"}}}},"400":{"description":"Returned upon a malformed request. Check your API key, URL parameters, and body parameters when this error is returned. Generally, if you see this error, that also means NO action was taken on our backend.","schema":{"allOf":[{"$ref":"#/components/schemas/ResponseBodyDto"}]},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBodyDto"}}}},"500":{"description":"Returned for all other errors. Generally these come from our backend. Some multipart functions may execute somewhat and then fail, causing some data to be updated.","schema":{"allOf":[{"$ref":"#/components/schemas/ResponseBodyDto"}]},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBodyDto"}}}}},"tags":["Admin - Members"]}}},"components":{"schemas":{"UpdateMemberDto":{"type":"object","properties":{"firstName":{"type":"string","description":"The customer's first name."},"lastName":{"type":"string","description":"The customer's last name."},"notes":{"type":"string","description":"Internal notes for this customer. Only viewable by the merchant."},"phoneNumber":{"type":"string","description":"The customer's phone number."},"birthday":{"type":"string","description":"The customer's date of birth in YYYY-MM-DD format, e.g \"1988-04-01\""}},"required":["firstName","lastName","notes","phoneNumber","birthday"]},"ResponseBodyDto":{"type":"object","properties":{"message":{"type":"string","description":"The message associated with the response. Generally, the message only confirms the requested action. In the case of errors, the message will give insight into the source of the error."},"data":{"type":"object","description":"The data associated with the response. Data is only returned from errors if the error originates from our backend to give further insight into the nature of the error."}},"required":["message","data"]}}}}
```

## POST /v2.0/admin/members/{id}/change-tier

> This endpoint allows to upgrade or downgrade a customer by specifying a new tierId.\<br>\<strong>Behavior Notes:\</strong> \<br>- A direct upgrade from a FREE tier to a PAID tier requires that the customer has an existing subscription contract. In other words, the customer must have previously been a paid member and then downgraded to a free tier.\<br>- If no subscription contract exists, attempts to move a customer from FREE to PAID will be rejected.\<br>- Downgrading from a PAID tier to FREE, or moving between PAID tiers, is allowed as long as it aligns with the customer’s subscription status.

```json
{"openapi":"3.0.0","info":{"title":"Inveterate Public API","version":"v2.0"},"paths":{"/v2.0/admin/members/{id}/change-tier":{"post":{"operationId":"ChangeTierController_create","summary":"","description":"This endpoint allows to upgrade or downgrade a customer by specifying a new tierId.<br><strong>Behavior Notes:</strong> <br>- A direct upgrade from a FREE tier to a PAID tier requires that the customer has an existing subscription contract. In other words, the customer must have previously been a paid member and then downgraded to a free tier.<br>- If no subscription contract exists, attempts to move a customer from FREE to PAID will be rejected.<br>- Downgrading from a PAID tier to FREE, or moving between PAID tiers, is allowed as long as it aligns with the customer’s subscription status.","parameters":[{"name":"X-Inveterate-Api-Key","in":"header","description":"Your private Inveterate API key.","required":true,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","description":"The customer ID number.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeTierDto"}}}},"responses":{"201":{"description":"Returned upon successful request made to our backend. Requests that return this code may take a small amount of time after successful API return to fully update.","schema":{"allOf":[{"$ref":"#/components/schemas/ResponseBodyDto"}]},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBodyDto"}}}},"400":{"description":"Returned upon a malformed request. Check your API key, URL parameters, and body parameters when this error is returned. Generally, if you see this error, that also means NO action was taken on our backend.","schema":{"allOf":[{"$ref":"#/components/schemas/ResponseBodyDto"}]},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBodyDto"}}}},"500":{"description":"Returned for all other errors. Generally these come from our backend. Some multipart functions may execute somewhat and then fail, causing some data to be updated.","schema":{"allOf":[{"$ref":"#/components/schemas/ResponseBodyDto"}]},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBodyDto"}}}}},"tags":["Admin - Change Tier"]}}},"components":{"schemas":{"ChangeTierDto":{"type":"object","properties":{"tierId":{"type":"string","description":"The ID of the tier to which the customer will be moved."},"nextBillingDate":{"type":"string","description":"The next billing date can be specified if the customer is changed to a paid tier. Format: YYYY-MM-DD"}},"required":["tierId","nextBillingDate"]},"ResponseBodyDto":{"type":"object","properties":{"message":{"type":"string","description":"The message associated with the response. Generally, the message only confirms the requested action. In the case of errors, the message will give insight into the source of the error."},"data":{"type":"object","description":"The data associated with the response. Data is only returned from errors if the error originates from our backend to give further insight into the nature of the error."}},"required":["message","data"]}}}}
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.inveterate.com/dev/api-reference-docs/public-api-2.0-reference/admin/members.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
