Loading...
Loading...
Manage Confluence spaces for project documentation. Create, list, and delete spaces with templates. Use when setting up project documentation structure or managing Confluence content areas.
npx skill4agent add 01000001-01001110/agent-jira-skills jira-spaces.envhttps://your-domain.atlassian.net/wiki/rest/api| Endpoint | Method | Description |
|---|---|---|
| GET | List all spaces |
| POST | Create a new space |
| GET | Get space details |
| DELETE | Delete a space |
| GET | List space content |
| Type | Description | Use Case |
|---|---|---|
| Site-wide space | Company wikis, shared docs |
| User's personal space | Individual notes, drafts |
const response = await fetch(`${CONFLUENCE_URL}/wiki/rest/api/space`, {
method: 'POST',
headers: {
'Authorization': `Basic ${auth}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
key: 'PROJ', // Unique space key (uppercase)
name: 'Project Docs', // Display name
type: 'global', // 'global' or 'personal'
description: {
plain: {
value: 'Documentation for the project',
representation: 'plain'
}
}
})
});{
"id": 12345,
"key": "PROJ",
"name": "Project Docs",
"type": "global",
"status": "current",
"_links": {
"webui": "/spaces/PROJ",
"self": "https://your-domain.atlassian.net/wiki/rest/api/space/PROJ"
}
}const response = await fetch(`${CONFLUENCE_URL}/wiki/rest/api/space?limit=25&type=global`, {
headers: {
'Authorization': `Basic ${auth}`,
'Accept': 'application/json'
}
});{
"results": [
{
"id": 12345,
"key": "PROJ",
"name": "Project Docs",
"type": "global",
"status": "current"
}
],
"start": 0,
"limit": 25,
"size": 1,
"_links": {}
}const response = await fetch(`${CONFLUENCE_URL}/wiki/rest/api/space/PROJ`, {
method: 'DELETE',
headers: {
'Authorization': `Basic ${auth}`
}
});PROJTEAMDOCKB// Create space with home page
await createSpace({
key: 'TUSTLE',
name: 'Tustle Project Documentation',
description: 'Technical documentation and guides for Tustle MVP'
});
// Add standard pages
await createPage('TUSTLE', 'Getting Started', 'Overview and setup instructions...');
await createPage('TUSTLE', 'Architecture', 'System architecture documentation...');
await createPage('TUSTLE', 'API Reference', 'API endpoint documentation...');const spaces = await listSpaces({ type: 'global', limit: 50 });
const teamSpaces = spaces.filter(s => s.name.includes('Team'));| Status | Meaning | Resolution |
|---|---|---|
| 400 | Invalid space key | Check key format (uppercase, no special chars) |
| 401 | Unauthorized | Check API token and email |
| 403 | Forbidden | User lacks space admin permissions |
| 404 | Space not found | Verify space key exists |
| 409 | Conflict | Space key already exists |
| Script | Description |
|---|---|
| Create a new Confluence space |
| Delete a space (with confirmation) |
| List all accessible spaces |
# List all spaces
node run.js list-spaces
# Create a new space
node run.js create-space DOCS "Documentation Space"
# Delete a space (interactive confirmation)
node run.js delete-space DOCS
# Force delete without confirmation
node run.js delete-space DOCS --confirmjira-projectsjira-issues