How could i build the api with expires number

i what to build api with expires number and with basic auth