Skip to main content

List Memberships belonging to a Project

GET/v2/projects/{projectId}/memberships
API version
v2
Request method
GET
Operation ID
project-list-memberships-for-project

Request​

  • projectIdstringrequired

    ID of the Project to list memberships for.

Responses​

Response headers
  • X-Pagination-Limitinteger

    The limit used to select the resources for the response

  • X-Pagination-Skipinteger

    The number of skipped items

  • X-Pagination-Pagenumber

    The calculate page of the list response. Refer to parameters to learn more.

  • X-Pagination-TotalCountinteger

    The total amount of items available in the remote ressource. Use this value in combination with the limit to calculate the available pages.

Format
application/json
Description

OK

  • Array[
    • *object
      • avatarRefstring (uuid)

        Avatar file reference id of the user.

      • emailstring (email)required

        Email used by the invited user.

      • expiresAtstring (date-time)

        Time the ProjectMembership should expire at.

      • firstNamestringrequired

        First name of the user.

      • idstring (uuid)required

        ID of the ProjectMembership.

      • inheritedbooleanrequired

        Whether the ProjectMembership was inherited from a CustomerMembership.

      • inviteIdstring (uuid)

        ID of the ProjectInvite the membership was created from.

      • lastNamestringrequired

        Last name of the user.

      • memberSincestring (date-time)

        Date the projectMembership was created at.

      • mfabooleanrequired

        MFA activated by the user.

      • projectIdstring (uuid)required

        ID of the Project the membership is for.

      • rolestring (one of: notset, owner, emailadmin, external)required
      • userIdstring (uuid)required

        ID of the user the ProjectMembership is for.

    ]
Content-Type: application/json

[
{
"avatarRef": "f0f86186-0a5a-45b2-aa33-502777496347",
"email": "email@mittwald.example",
"expiresAt": "1985-10-26T01:21:00.000Z",
"firstName": "string",
"id": "f0f86186-0a5a-45b2-aa33-502777496347",
"inherited": true,
"inviteId": "f0f86186-0a5a-45b2-aa33-502777496347",
"lastName": "string",
"memberSince": "1985-10-26T01:21:00.000Z",
"mfa": true,
"projectId": "f0f86186-0a5a-45b2-aa33-502777496347",
"role": "notset",
"userId": "f0f86186-0a5a-45b2-aa33-502777496347"
}
]
{
"items": {
"properties": {
"avatarRef": {
"description": "Avatar file reference id of the user.",
"format": "uuid",
"type": "string"
},
"email": {
"description": "Email used by the invited user.",
"format": "email",
"type": "string"
},
"expiresAt": {
"description": "Time the ProjectMembership should expire at.",
"format": "date-time",
"type": "string"
},
"firstName": {
"description": "First name of the user.",
"type": "string"
},
"id": {
"description": "ID of the ProjectMembership.",
"format": "uuid",
"type": "string"
},
"inherited": {
"description": "Whether the ProjectMembership was inherited from a CustomerMembership.",
"type": "boolean"
},
"inviteId": {
"description": "ID of the ProjectInvite the membership was created from.",
"format": "uuid",
"type": "string"
},
"lastName": {
"description": "Last name of the user.",
"type": "string"
},
"memberSince": {
"description": "Date the projectMembership was created at.",
"format": "date-time",
"type": "string"
},
"mfa": {
"description": "MFA activated by the user.",
"type": "boolean"
},
"projectId": {
"description": "ID of the Project the membership is for.",
"format": "uuid",
"type": "string"
},
"role": {
"enum": [
"notset",
"owner",
"emailadmin",
"external"
],
"type": "string"
},
"userId": {
"description": "ID of the user the ProjectMembership is for.",
"format": "uuid",
"type": "string"
}
},
"required": [
"id",
"projectId",
"userId",
"role",
"inherited",
"email",
"mfa",
"firstName",
"lastName"
],
"type": "object"
},
"type": "array"
}

Usage examples​

$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/projects/string/memberships?hasExpiry=true&isInherited=true&role=notset&hasMfa=true&searchTerm=string&limit=50&page=1
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";

const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.project.listMembershipsForProject({
"projectId": "string",
"queryParameters": {
"hasExpiry": true,
"isInherited": true,
"role": "notset",
"hasMfa": true,
"searchTerm": "string",
"limit": 50,
"page": 1
}
});

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\Project\ListMembershipsForProject\ListMembershipsForProjectRequest;

$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));

$request = (new ListMembershipsForProjectRequest(
projectId: "string"
))
->withHasExpiry(true)
->withIsInherited(true)
->withRole("notset")
->withHasMfa(true)
->withSearchTerm("string")
->withLimit(50)
->withPage(1);
$response = $client->project()->listMembershipsForProject($request);

var_dump($response->getBody();

On this page