Skip to main content

Get My Guild

Retrieve the guild for which the current user is an administrator.

Endpoint

GET /api/v2/guilds/me

Authentication

This endpoint requires user authentication with a JWT token:

Authorization: Bearer user-jwt-token-here

Description

Returns the guild that the authenticated user owns or administers. Returns 404 if the user does not have a guild.

Request Example

GET /api/v2/guilds/me

Response

Success Response (200)

{
"id": "guild-123",
"slug": "my-awesome-guild",
"name": "My Awesome Guild",
"description": "A community of passionate gamers",
"logo": "https://example.com/logo.png",
"website": "https://myguild.com",
"social": [
{
"service": "DISCORD",
"username": "discover"
},
{
"service": "TWITTER",
"username": "myguild"
}
],
"size": 42,
"adminId": "user-456",
"createdAt": 1672531200000,
"updatedAt": 1704067200000
}

Error Response (401)

{
"message": "Unauthorized",
"status": 401
}

Error Response (404)

{
"message": "You don't have a guild",
"status": 404
}

Response Fields

FieldTypeDescription
idstringUnique guild identifier
slugstringURL-friendly guild identifier
namestringGuild name
descriptionstringGuild description
logostringGuild logo URL (optional)
websitestringGuild website URL (optional)
socialobject[]Social media links (optional)
sizenumberCurrent member count
adminIdstringUser ID of the guild administrator
createdAtnumberCreation timestamp (Unix ms)
updatedAtnumberLast update timestamp (Unix ms)

Usage Example

const response = await fetch("https://api.intraverse.io/api/v2/guilds/me", {
headers: {
Authorization: `Bearer ${jwtToken}`,
},
});

if (response.ok) {
const guild = await response.json();
console.log(`Your guild: ${guild.name} (${guild.size} members)`);
} else if (response.status === 404) {
console.log("You don't have a guild yet");
}

Next Steps