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
| Field | Type | Description |
|---|---|---|
id | string | Unique guild identifier |
slug | string | URL-friendly guild identifier |
name | string | Guild name |
description | string | Guild description |
logo | string | Guild logo URL (optional) |
website | string | Guild website URL (optional) |
social | object[] | Social media links (optional) |
size | number | Current member count |
adminId | string | User ID of the guild administrator |
createdAt | number | Creation timestamp (Unix ms) |
updatedAt | number | Last 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");
}