Skip to content
This repository was archived by the owner on Jun 20, 2026. It is now read-only.

Important

Project Sunset Notice 🌇

This project is no longer actively maintained.

After careful consideration, we’ve decided to sunset development and support for this repository. While it has been a valuable effort, we are no longer able to dedicate the time and resources required to maintain it at the level we consider responsible.

Forking and continuation

If you are interested in taking over maintenance or building upon this project, you are encouraged to fork it.

Thank you

We sincerely appreciate everyone who contributed, reported issues, or used this project. Your support made it worthwhile.


GoReportCard GitHub Actions CI Status GitHub Actions CodeQL Status

Usage exampleCI StatusLicense


go-confluence is a Go package for working with Confluence REST API.

Important

Please note that this package only supports retrieving data from the Confluence API (i.e. you cannot create or modify data with this package).

Usage example

Authentication with username and password.

package main

import (
  "fmt"
  cf "github.com/essentialkaos/go-confluence/v6"
)

func main() {
  api, err := cf.NewAPI("https://confluence.domain.com", cf.AuthBasic{"john", "MySuppaPAssWOrd"})

  api.SetUserAgent("MyApp", "1.2.3")

  if err != nil {
    fmt.Printf("Error: %v\n", err)
    return
  }

  content, err := api.GetContentByID(
    "18173522", cf.ContentIDParameters{
      Version: 4,
      Expand:  []string{"space", "body.view", "version"},
    },
  )

  if err != nil {
    fmt.Printf("Error: %v\n", err)
    return
  }

  fmt.Printf("ID: %s\n", content.ID)
}

Authentication with personal token. Please make sure your confluence 7.9 version and later. See Using Personal Access Tokens guide

package main

import (
  "fmt"

  cf "github.com/essentialkaos/go-confluence/v6"
)

func main() {
  api, err := cf.NewAPI("https://confluence.domain.com", cf.AuthToken{"avaMTxxxqKaxpFHpmwHPXhjmUFfAJMaU3VXUji73EFhf"})

  api.SetUserAgent("MyApp", "1.2.3")

  if err != nil {
    fmt.Printf("Error: %v\n", err)
    return
  }

  content, err := api.GetContentByID(
    "18173522", cf.ContentIDParameters{
      Version: 4,
      Expand:  []string{"space", "body.view", "version"},
    },
  )
  if err != nil {
    fmt.Printf("Error: %v\n", err)
    return
  }

  fmt.Printf("ID: %s\n", content.ID)
}

CI Status

Branch Status
master (Stable) CI
develop (Unstable) CI

Contributing

Before contributing to this project please read our Contributing Guidelines.

License

Apache License, Version 2.0

About

Go package for working with Atlassian Confluence Server REST API

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

33 stars

Watchers

2 watching

Forks

Releases

Used by

Contributors

Languages